Skip to content

Commit 0b88ff0

Browse files
authored
Merge pull request #17 from nhatthm/bump-dependencies
Bump dependencies
2 parents ede385f + 9dfda2a commit 0b88ff0

File tree

9 files changed

+62
-14
lines changed

9 files changed

+62
-14
lines changed

.github/workflows/lint.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,15 @@ jobs:
2020
with:
2121
go-version: ${{ env.GO_VERSION }}
2222

23-
- id: get-lint-version
23+
- id: vars
2424
run: |
25-
make golangci-lint-version
25+
make $GITHUB_OUTPUT
2626
2727
- name: lint
2828
uses: golangci/golangci-lint-action@v3
2929
with:
3030
# Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version.
31-
version: ${{ steps.get-lint-version.outputs.GOLANGCI_LINT_VERSION }}
31+
version: ${{ steps.vars.outputs.GOLANGCI_LINT_VERSION }}
3232

3333
# Optional: working directory, useful for monorepos
3434
# working-directory: somedir

.github/workflows/test.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
fail-fast: false
1717
matrix:
1818
os: [ ubuntu-latest, macos-latest ]
19-
go-version: [ 1.17.x, 1.18.x, 1.19.x ]
19+
go-version: [ 1.18.x, 1.19.x ]
2020
runs-on: ${{ matrix.os }}
2121
steps:
2222
- name: Install Go
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
---
2+
name: 'update-registry'
3+
4+
on:
5+
push:
6+
branches:
7+
- master
8+
tags:
9+
- v*
10+
workflow_dispatch:
11+
12+
jobs:
13+
notify:
14+
runs-on: ubuntu-latest
15+
strategy:
16+
matrix:
17+
registry: [ go.nhat.io, go-staging.nhat.io ]
18+
steps:
19+
- uses: actions/checkout@v3
20+
21+
- id: vars
22+
run: |
23+
make $GITHUB_OUTPUT
24+
25+
- name: notify ${{ matrix.registry }}
26+
uses: benc-uk/workflow-dispatch@v121
27+
with:
28+
workflow: build
29+
repo: nhatthm/${{ matrix.registry }}
30+
token: ${{ secrets.REGISTRY_TOKEN }}
31+
inputs: '{"modules": "${{ steps.vars.outputs.MODULE_NAME }}"}'
32+
ref: 'master'

.golangci.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ linters-settings:
2020
linters:
2121
enable-all: true
2222
disable:
23+
- deadcode
2324
- exhaustivestruct
2425
- exhaustruct
2526
- forbidigo
@@ -33,13 +34,15 @@ linters:
3334
- ireturn
3435
- lll
3536
- maligned
37+
- nolintlint # https://github.com/golangci/golangci-lint/issues/3063
3638
- nonamedreturns
3739
- nosnakecase
38-
- nolintlint # https://github.com/golangci/golangci-lint/issues/3063
3940
- paralleltest
4041
- scopelint
42+
- structcheck
4143
- tagliatelle
4244
- testpackage
45+
- varcheck
4346
- varnamelen
4447
- wrapcheck
4548

Makefile

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,23 @@
1+
MODULE_NAME=httpmock
2+
13
VENDOR_DIR = vendor
24

3-
GOLANGCI_LINT_VERSION ?= v1.48.0
5+
GOLANGCI_LINT_VERSION ?= v1.50.1
46

57
GO ?= go
68
GOLANGCI_LINT ?= $(shell go env GOPATH)/bin/golangci-lint-$(GOLANGCI_LINT_VERSION)
79

10+
GITHUB_OUTPUT ?= /dev/null
11+
812
.PHONY: $(VENDOR_DIR)
913
$(VENDOR_DIR):
1014
@mkdir -p $(VENDOR_DIR)
1115
@$(GO) mod vendor
1216

17+
.PHONY: tidy
18+
tidy:
19+
@$(GO) mod tidy
20+
1321
.PHONY: lint
1422
lint: $(GOLANGCI_LINT) $(VENDOR_DIR)
1523
@$(GOLANGCI_LINT) run -c .golangci.yaml
@@ -23,9 +31,10 @@ test-unit:
2331
@echo ">> unit test"
2432
@$(GO) test -gcflags=-l -coverprofile=unit.coverprofile -covermode=atomic -race ./...
2533

26-
.PHONY: golangci-lint-version
27-
golangci-lint-version:
28-
@echo "::set-output name=GOLANGCI_LINT_VERSION::$(GOLANGCI_LINT_VERSION)"
34+
.PHONY: $(GITHUB_OUTPUT)
35+
$(GITHUB_OUTPUT):
36+
@echo "MODULE_NAME=$(MODULE_NAME)" >> "$@"
37+
@echo "GOLANGCI_LINT_VERSION=$(GOLANGCI_LINT_VERSION)" >> "$@"
2938

3039
$(GOLANGCI_LINT):
3140
@echo "$(OK_COLOR)==> Installing golangci-lint $(GOLANGCI_LINT_VERSION)$(NO_COLOR)"; \

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ support HTTP behavioral tests.
3434

3535
## Prerequisites
3636

37-
- `Go >= 1.17`
37+
- `Go >= 1.18`
3838

3939
[<sub><sup>[table of contents]</sup></sub>](#table-of-contents)
4040

go.mod

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
module go.nhat.io/httpmock
22

3-
go 1.17
3+
go 1.18
44

55
require (
66
github.com/stretchr/testify v1.8.1
77
go.nhat.io/matcher/v2 v2.0.0
88
)
99

1010
require (
11-
github.com/bool64/shared v0.1.4 // indirect
11+
github.com/bool64/shared v0.1.5 // indirect
1212
github.com/davecgh/go-spew v1.1.1 // indirect
1313
github.com/fsnotify/fsnotify v1.5.4 // indirect
1414
github.com/iancoleman/orderedmap v0.2.0 // indirect
1515
github.com/pmezard/go-difflib v1.0.0 // indirect
16-
github.com/sergi/go-diff v1.2.0 // indirect
16+
github.com/sergi/go-diff v1.3.1 // indirect
1717
github.com/stretchr/objx v0.5.0 // indirect
1818
github.com/swaggest/assertjson v1.7.0 // indirect
1919
github.com/yudai/gojsondiff v1.0.0 // indirect

go.sum

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ github.com/bool64/dev v0.2.10 h1:ypAGBazcwyIy2JvIJio8V3kdqO7AgIAYvcckW54qxr4=
33
github.com/bool64/dev v0.2.10/go.mod h1:/csLrm+4oDSsKJRIVS0mrywAonLnYKFG8RvGT7Jh9b8=
44
github.com/bool64/shared v0.1.4 h1:zwtb1dl2QzDa9TJOq2jzDTdb5IPf9XlxTGKN8cySWT0=
55
github.com/bool64/shared v0.1.4/go.mod h1:ryGjsnQFh6BnEXClfVlEJrzjwzat7CmA8PNS5E+jPp0=
6+
github.com/bool64/shared v0.1.5 h1:fp3eUhBsrSjNCQPcSdQqZxxh9bBwrYiZ+zOKFkM0/2E=
7+
github.com/bool64/shared v0.1.5/go.mod h1:081yz68YC9jeFB3+Bbmno2RFWvGKv1lPKkMP6MHJlPs=
68
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
79
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
810
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
@@ -53,6 +55,8 @@ github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZN
5355
github.com/sergi/go-diff v1.1.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM=
5456
github.com/sergi/go-diff v1.2.0 h1:XU+rvMAioB0UC3q1MFrIQy4Vo5/4VsRDQQXHsEya6xQ=
5557
github.com/sergi/go-diff v1.2.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM=
58+
github.com/sergi/go-diff v1.3.1 h1:xkr+Oxo4BOQKmkn/B9eMK0g5Kg/983T9DqqPHwYqD+8=
59+
github.com/sergi/go-diff v1.3.1/go.mod h1:aMJSSKb2lpPvRNec0+w3fl7LP9IOFzdc9Pa4NFbPK1I=
5660
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
5761
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
5862
github.com/stretchr/objx v0.5.0 h1:1zr/of2m5FGMsad5YfcqgdqdWrIhu+EBEJRhR1U7z/c=

helper.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ func DoRequest(
2828
// DoRequestWithTimeout sends a simple HTTP Request for testing and returns the status code, response headers and
2929
// response body along with the total execution time.
3030
//
31-
// code, headers, body, _ = DoRequestWithTimeout(t, http.MethodGet, "/", nil, nil, 0)
31+
// code, headers, body, _ = DoRequestWithTimeout(t, http.MethodGet, "/", map[string]string{}, nil, 0)
3232
func DoRequestWithTimeout(
3333
tb testing.TB,
3434
method, requestURI string,

0 commit comments

Comments
 (0)