Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump dependencies #17

Merged
merged 1 commit into from
Jan 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@ jobs:
with:
go-version: ${{ env.GO_VERSION }}

- id: get-lint-version
- id: vars
run: |
make golangci-lint-version
make $GITHUB_OUTPUT

- name: lint
uses: golangci/golangci-lint-action@v3
with:
# Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version.
version: ${{ steps.get-lint-version.outputs.GOLANGCI_LINT_VERSION }}
version: ${{ steps.vars.outputs.GOLANGCI_LINT_VERSION }}

# Optional: working directory, useful for monorepos
# working-directory: somedir
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
fail-fast: false
matrix:
os: [ ubuntu-latest, macos-latest ]
go-version: [ 1.17.x, 1.18.x, 1.19.x ]
go-version: [ 1.18.x, 1.19.x ]
runs-on: ${{ matrix.os }}
steps:
- name: Install Go
Expand Down
32 changes: 32 additions & 0 deletions .github/workflows/update-registry.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
---
name: 'update-registry'

on:
push:
branches:
- master
tags:
- v*
workflow_dispatch:

jobs:
notify:
runs-on: ubuntu-latest
strategy:
matrix:
registry: [ go.nhat.io, go-staging.nhat.io ]
steps:
- uses: actions/checkout@v3

- id: vars
run: |
make $GITHUB_OUTPUT

- name: notify ${{ matrix.registry }}
uses: benc-uk/workflow-dispatch@v121
with:
workflow: build
repo: nhatthm/${{ matrix.registry }}
token: ${{ secrets.REGISTRY_TOKEN }}
inputs: '{"modules": "${{ steps.vars.outputs.MODULE_NAME }}"}'
ref: 'master'
5 changes: 4 additions & 1 deletion .golangci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ linters-settings:
linters:
enable-all: true
disable:
- deadcode
- exhaustivestruct
- exhaustruct
- forbidigo
Expand All @@ -33,13 +34,15 @@ linters:
- ireturn
- lll
- maligned
- nolintlint # https://github.com/golangci/golangci-lint/issues/3063
- nonamedreturns
- nosnakecase
- nolintlint # https://github.com/golangci/golangci-lint/issues/3063
- paralleltest
- scopelint
- structcheck
- tagliatelle
- testpackage
- varcheck
- varnamelen
- wrapcheck

Expand Down
17 changes: 13 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,15 +1,23 @@
MODULE_NAME=httpmock

VENDOR_DIR = vendor

GOLANGCI_LINT_VERSION ?= v1.48.0
GOLANGCI_LINT_VERSION ?= v1.50.1

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

GITHUB_OUTPUT ?= /dev/null

.PHONY: $(VENDOR_DIR)
$(VENDOR_DIR):
@mkdir -p $(VENDOR_DIR)
@$(GO) mod vendor

.PHONY: tidy
tidy:
@$(GO) mod tidy

.PHONY: lint
lint: $(GOLANGCI_LINT) $(VENDOR_DIR)
@$(GOLANGCI_LINT) run -c .golangci.yaml
Expand All @@ -23,9 +31,10 @@ test-unit:
@echo ">> unit test"
@$(GO) test -gcflags=-l -coverprofile=unit.coverprofile -covermode=atomic -race ./...

.PHONY: golangci-lint-version
golangci-lint-version:
@echo "::set-output name=GOLANGCI_LINT_VERSION::$(GOLANGCI_LINT_VERSION)"
.PHONY: $(GITHUB_OUTPUT)
$(GITHUB_OUTPUT):
@echo "MODULE_NAME=$(MODULE_NAME)" >> "$@"
@echo "GOLANGCI_LINT_VERSION=$(GOLANGCI_LINT_VERSION)" >> "$@"

$(GOLANGCI_LINT):
@echo "$(OK_COLOR)==> Installing golangci-lint $(GOLANGCI_LINT_VERSION)$(NO_COLOR)"; \
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ support HTTP behavioral tests.

## Prerequisites

- `Go >= 1.17`
- `Go >= 1.18`

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

Expand Down
6 changes: 3 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
module go.nhat.io/httpmock

go 1.17
go 1.18

require (
github.com/stretchr/testify v1.8.1
go.nhat.io/matcher/v2 v2.0.0
)

require (
github.com/bool64/shared v0.1.4 // indirect
github.com/bool64/shared v0.1.5 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/fsnotify/fsnotify v1.5.4 // indirect
github.com/iancoleman/orderedmap v0.2.0 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/sergi/go-diff v1.2.0 // indirect
github.com/sergi/go-diff v1.3.1 // indirect
github.com/stretchr/objx v0.5.0 // indirect
github.com/swaggest/assertjson v1.7.0 // indirect
github.com/yudai/gojsondiff v1.0.0 // indirect
Expand Down
4 changes: 4 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ github.com/bool64/dev v0.2.10 h1:ypAGBazcwyIy2JvIJio8V3kdqO7AgIAYvcckW54qxr4=
github.com/bool64/dev v0.2.10/go.mod h1:/csLrm+4oDSsKJRIVS0mrywAonLnYKFG8RvGT7Jh9b8=
github.com/bool64/shared v0.1.4 h1:zwtb1dl2QzDa9TJOq2jzDTdb5IPf9XlxTGKN8cySWT0=
github.com/bool64/shared v0.1.4/go.mod h1:ryGjsnQFh6BnEXClfVlEJrzjwzat7CmA8PNS5E+jPp0=
github.com/bool64/shared v0.1.5 h1:fp3eUhBsrSjNCQPcSdQqZxxh9bBwrYiZ+zOKFkM0/2E=
github.com/bool64/shared v0.1.5/go.mod h1:081yz68YC9jeFB3+Bbmno2RFWvGKv1lPKkMP6MHJlPs=
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
Expand Down Expand Up @@ -53,6 +55,8 @@ github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZN
github.com/sergi/go-diff v1.1.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM=
github.com/sergi/go-diff v1.2.0 h1:XU+rvMAioB0UC3q1MFrIQy4Vo5/4VsRDQQXHsEya6xQ=
github.com/sergi/go-diff v1.2.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM=
github.com/sergi/go-diff v1.3.1 h1:xkr+Oxo4BOQKmkn/B9eMK0g5Kg/983T9DqqPHwYqD+8=
github.com/sergi/go-diff v1.3.1/go.mod h1:aMJSSKb2lpPvRNec0+w3fl7LP9IOFzdc9Pa4NFbPK1I=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
github.com/stretchr/objx v0.5.0 h1:1zr/of2m5FGMsad5YfcqgdqdWrIhu+EBEJRhR1U7z/c=
Expand Down
2 changes: 1 addition & 1 deletion helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ func DoRequest(
// DoRequestWithTimeout sends a simple HTTP Request for testing and returns the status code, response headers and
// response body along with the total execution time.
//
// code, headers, body, _ = DoRequestWithTimeout(t, http.MethodGet, "/", nil, nil, 0)
// code, headers, body, _ = DoRequestWithTimeout(t, http.MethodGet, "/", map[string]string{}, nil, 0)
func DoRequestWithTimeout(
tb testing.TB,
method, requestURI string,
Expand Down