From a55e9610f3ebbdd6e579dc9233d035e71042436f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maxime=20Soul=C3=A9?= Date: Tue, 18 Oct 2022 21:51:37 +0200 Subject: [PATCH] refactor: go1.13 required now, so drop go1.9 to go1.12 support MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Maxime Soulé --- .github/workflows/ci.yml | 15 +++---------- README.md | 46 ++-------------------------------------- 2 files changed, 5 insertions(+), 56 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4f5bf28..39441e9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,7 +10,7 @@ jobs: test: strategy: matrix: - go-version: [1.9.x, 1.10.x, 1.11.x, 1.12.x, 1.13.x, 1.14.x, 1.15.x, 1.16.x, 1.17.x, 1.18.x, tip] + go-version: [1.13.x, 1.14.x, 1.15.x, 1.16.x, 1.17.x, 1.18.x, tip] full-tests: [false] include: - go-version: 1.19.x @@ -31,7 +31,7 @@ jobs: if: matrix.full-tests run: | curl -sL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | - sh -s -- -b $HOME/go/bin v1.49.0 + sh -s -- -b $HOME/go/bin v1.50.1 $HOME/go/bin/golangci-lint run --max-issues-per-linter 0 \ --max-same-issues 0 \ -E bidichk \ @@ -54,15 +54,6 @@ jobs: if [ ${{ matrix.full-tests }} = true ]; then GO_TEST_OPTS="-covermode=atomic -coverprofile=coverage.out" fi - case ${{ matrix.go-version }} in - 1.9.x | 1.10.x) # Before go 1.11, go modules are not available - mkdir -p ../src/github.com/$GITHUB_REPOSITORY_OWNER - ln -s $(pwd) ../src/github.com/$GITHUB_REPOSITORY - export GOPATH=$(dirname $(pwd)) - cd $GOPATH/src/github.com/$GITHUB_REPOSITORY - go get -t ./... - ;; - esac export GORACE="halt_on_error=1" go test -race $GO_TEST_OPTS ./... @@ -71,5 +62,5 @@ jobs: env: COVERALLS_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | - go install github.com/mattn/goveralls@v0.0.9 + go install github.com/mattn/goveralls@v0.0.11 goveralls -coverprofile=coverage.out -service=github diff --git a/README.md b/README.md index 9425f1e..b5fc793 100644 --- a/README.md +++ b/README.md @@ -4,61 +4,19 @@ Easy mocking of http responses from external resources. ## Install -Currently supports Go 1.9 - 1.19. +Currently supports Go 1.13 to 1.19 and is regularly tested against tip. `v1` branch has to be used instead of `master`. - -### Using go modules (aka. `go mod`) - In your go files, simply use: ```go import "github.com/jarcoal/httpmock" ``` Then next `go mod tidy` or `go test` invocation will automatically -populate your `go.mod` with the last httpmock release, now +populate your `go.mod` with the latest httpmock release, now [![Version](https://img.shields.io/github/tag/jarcoal/httpmock.svg)](https://github.com/jarcoal/httpmock/releases). -Note you can use `go mod vendor` to vendor your dependencies. - - -### Using `$GOPATH` - -`v1` branch is configured as the default branch in github, so: -``` -go get github.com/jarcoal/httpmock -``` - -automatically downloads the `v1` branch in `$GOPATH/src`. Then in your -go files use: -```go -import "github.com/jarcoal/httpmock" -``` - - -### Vendoring, using [`govendor`](https://github.com/kardianos/govendor) for example - -When vendoring is used, `v1` branch has to be specified. Two choices here: - -- preferred way: - ``` - govendor fetch github.com/jarcoal/httpmock@v1 - ``` - then in go files: - ```go - import "github.com/jarcoal/httpmock" - ``` -- old way (before `v1` was set as default branch), use gopkg to read from - `v1` branch: - ``` - govendor fetch gopkg.in/jarcoal/httpmock.v1 - ``` - then in go files: - ```go - import "gopkg.in/jarcoal/httpmock.v1" - ``` - ## Usage