Skip to content

Commit 1f4abbb

Browse files
authored
Bump to Go 1.22 (#44)
Also cleanup old links
1 parent e3fb1a5 commit 1f4abbb

File tree

6 files changed

+42
-56
lines changed

6 files changed

+42
-56
lines changed

.github/workflows/test.yml

Lines changed: 29 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,53 +1,43 @@
1-
name: Test
1+
name: 'Test'
22

33
on:
44
push:
55
branches:
6-
- main
6+
- 'main'
77
tags:
8-
- '*'
8+
- '*'
99
pull_request:
1010
branches:
11-
- main
11+
- 'main'
1212

1313
jobs:
1414
# unit runs the unit tests
1515
unit:
1616
strategy:
1717
fail-fast: false
1818
matrix:
19-
go:
20-
- '1.14'
21-
- '1.15'
22-
- '1.16'
23-
- '1.17'
2419
os:
25-
- 'macos-latest'
26-
- 'ubuntu-latest'
27-
- 'windows-latest'
20+
- 'macos-latest'
21+
- 'ubuntu-latest'
22+
- 'windows-latest'
2823

29-
runs-on: ${{ matrix.os }}
24+
runs-on: '${{ matrix.os }}'
3025

3126
steps:
32-
- uses: actions/checkout@v2
27+
- uses: 'actions/checkout@v4'
3328

34-
- uses: actions/setup-go@v2
29+
- uses: 'actions/setup-go@v5'
3530
with:
36-
go-version: ${{ matrix.go }}
37-
38-
- uses: actions/cache@v2
39-
with:
40-
path: ~/go/pkg/mod
41-
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
42-
restore-keys: |
43-
${{ runner.os }}-go-
31+
go-version-file: 'go.mod'
4432

4533
- name: Lint
46-
run: make fmtcheck staticcheck spellcheck
47-
if: ${{ matrix.os == 'ubuntu-latest' && matrix.go == '1.16' }}
34+
if: ${{ matrix.os == 'ubuntu-latest' }}
35+
run: |-
36+
make fmtcheck staticcheck spellcheck
4837
4938
- name: Test
50-
run: make test
39+
run: |-
40+
make test-acc
5141
5242
# build runs go build on the target platforms to ensure the runtime links are
5343
# correct.
@@ -56,34 +46,28 @@ jobs:
5646
fail-fast: false
5747
matrix:
5848
goos:
59-
- 'darwin'
60-
- 'freebsd'
61-
- 'linux'
62-
- 'netbsd'
63-
- 'openbsd'
64-
- 'solaris'
65-
- 'windows'
49+
- 'darwin'
50+
- 'freebsd'
51+
- 'linux'
52+
- 'netbsd'
53+
- 'openbsd'
54+
- 'solaris'
55+
- 'windows'
6656
goarch:
67-
- 'amd64'
57+
- 'amd64'
6858

6959
runs-on: 'ubuntu-latest'
7060

7161
steps:
72-
- uses: actions/checkout@v2
73-
74-
- uses: actions/setup-go@v2
75-
with:
76-
go-version: '1.16'
62+
- uses: 'actions/checkout@v4'
7763

78-
- uses: actions/cache@v2
64+
- uses: 'actions/setup-go@v5'
7965
with:
80-
path: ~/go/pkg/mod
81-
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
82-
restore-keys: |
83-
${{ runner.os }}-go-
66+
go-version-file: 'go.mod'
8467

8568
- name: Build
8669
env:
8770
GOOS: ${{ matrix.goos }}
8871
GOARCH: ${{ matrix.goarch }}
89-
run: go build ./...
72+
run: |-
73+
go build -a ./...

Makefile

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
1-
VETTERS = "asmdecl,assign,atomic,bools,buildtag,cgocall,composites,copylocks,errorsas,httpresponse,loopclosure,lostcancel,nilfunc,printf,shift,stdmethods,structtag,tests,unmarshal,unreachable,unsafeptr,unusedresult"
21
GOFMT_FILES = $(shell go list -f '{{.Dir}}' ./...)
32

43
benchmarks:
54
@(cd benchmarks/ && go test -bench=. -benchmem -benchtime=1s ./...)
65
.PHONY: benchmarks
76

87
fmtcheck:
9-
@command -v goimports > /dev/null 2>&1 || (cd tools/ && go get golang.org/x/tools/cmd/goimports)
8+
@command -v goimports > /dev/null 2>&1 || (cd tools/ && go install golang.org/x/tools/cmd/goimports@latest)
109
@CHANGES="$$(goimports -d $(GOFMT_FILES))"; \
1110
if [ -n "$${CHANGES}" ]; then \
1211
echo "Unformatted (run goimports -w .):\n\n$${CHANGES}\n\n"; \
@@ -21,29 +20,31 @@ fmtcheck:
2120
.PHONY: fmtcheck
2221

2322
spellcheck:
24-
@command -v misspell > /dev/null 2>&1 || (cd tools/ && go get github.com/client9/misspell/cmd/misspell)
23+
@command -v misspell > /dev/null 2>&1 || (cd tools/ && go install github.com/client9/misspell/cmd/misspell@latest)
2524
@misspell -locale="US" -error -source="text" **/*
2625
.PHONY: spellcheck
2726

2827
staticcheck:
29-
@command -v staticcheck > /dev/null 2>&1 || (cd tools/ && go get honnef.co/go/tools/cmd/staticcheck)
28+
@command -v staticcheck > /dev/null 2>&1 || (cd tools/ && go install honnef.co/go/tools/cmd/staticcheck@latest)
3029
@staticcheck -checks="all" -tests $(GOFMT_FILES)
3130
.PHONY: staticcheck
3231

3332
test:
3433
@go test \
3534
-count=1 \
35+
-shuffle=on \
3636
-short \
3737
-timeout=5m \
38-
-vet="${VETTERS}" \
38+
-vet=all \
3939
./...
4040
.PHONY: test
4141

4242
test-acc:
4343
@go test \
4444
-count=1 \
45+
-shuffle=on \
4546
-race \
4647
-timeout=10m \
47-
-vet="${VETTERS}" \
48+
-vet=all \
4849
./...
4950
.PHONY: test-acc

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Go Rate Limiter
22

3-
[![GoDoc](https://img.shields.io/badge/go-documentation-blue.svg?style=flat-square)](https://pkg.go.dev/mod/github.com/sethvargo/go-limiter)
4-
[![GitHub Actions](https://img.shields.io/github/workflow/status/sethvargo/go-limiter/Test?style=flat-square)](https://github.com/sethvargo/go-limiter/actions?query=workflow%3ATest)
3+
[![GoDoc](https://img.shields.io/badge/go-documentation-blue.svg?style=flat-square)](https://pkg.go.dev/github.com/sethvargo/go-limiter)
4+
[![GitHub Actions](https://img.shields.io/github/actions/workflow/status/sethvargo/go-limiter/test.yml?style=flat-square)](https://github.com/sethvargo/go-limiter/actions/workflows/test.yml)
55

66

77
This package provides a rate limiter in Go (Golang), suitable for use in HTTP

go.mod

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
module github.com/sethvargo/go-limiter
22

3-
go 1.14
3+
go 1.22
4+
5+
toolchain go1.22.1

internal/fasttime/fasttime.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
//go:build !windows
2-
// +build !windows
32

43
// Package fasttime gets wallclock time, but super fast.
54
package fasttime

internal/fasttime/fasttime_windows.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// +build windows
1+
//go:build windows
22

33
package fasttime
44

0 commit comments

Comments
 (0)