diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml new file mode 100644 index 0000000..9c135f2 --- /dev/null +++ b/.github/workflows/ci.yaml @@ -0,0 +1,36 @@ +name: Run tests + +on: + pull_request: + branches: [master] + push: + branches: [master] + +jobs: + test: + runs-on: ubuntu-latest + strategy: + matrix: + go: ["1.18", "1.19", "1.20", "1.21", "1.22", "1.23", "1.24"] + + steps: + - uses: actions/checkout@v4 + + - name: Set up Go ${{ matrix.go }} + uses: actions/setup-go@v5 + with: + go-version: ${{ matrix.go }} + + - name: Build + run: go build -v ./... + + - name: gofmt + run: | + unformatted_files=$(gofmt -l .) + if [ -n "$unformatted_files" ]; then + echo "The following files are not Go formatted:" + echo "$unformatted_files" + echo "Please run 'gofmt -w .' to fix them." + exit 1 + fi + echo "All Go files are well formatted." diff --git a/go.mod b/go.mod index 948aa5c..238a50f 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/ipinfo/go/v2 -go 1.15 +go 1.18 require ( github.com/patrickmn/go-cache v2.1.0+incompatible diff --git a/ipinfo/doc.go b/ipinfo/doc.go index f973863..689c33a 100644 --- a/ipinfo/doc.go +++ b/ipinfo/doc.go @@ -10,7 +10,7 @@ For example: info, err := ipinfo.GetIPInfo(net.ParseIP("8.8.8.8")) -Authorization +# Authorization To perform authorized API calls with more data and higher limits, pass in a non-empty token to NewClient. For example: