Skip to content

Commit

Permalink
refactor: go1.13 required now, so drop go1.9 to go1.12 support
Browse files Browse the repository at this point in the history
Signed-off-by: Maxime Soulé <btik-git@scoubidou.com>
  • Loading branch information
maxatome committed Nov 7, 2022
1 parent f6c4876 commit a55e961
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 56 deletions.
15 changes: 3 additions & 12 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 \
Expand All @@ -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 ./...
Expand All @@ -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
46 changes: 2 additions & 44 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit a55e961

Please sign in to comment.