File tree Expand file tree Collapse file tree 5 files changed +49
-27
lines changed Expand file tree Collapse file tree 5 files changed +49
-27
lines changed Original file line number Diff line number Diff line change 1
- ---
2
1
name : CI
3
- on : # yamllint disable-line rule:truthy
4
- pull_request :
2
+ on :
5
3
push :
6
4
jobs :
7
5
test :
8
6
name : Test
9
7
runs-on : ubuntu-latest
8
+ strategy :
9
+ matrix :
10
+ go_version : ["1.20", "1.21"]
10
11
container :
11
- image : quay.io/prometheus/golang-builder:1.20-base
12
+ image : quay.io/prometheus/golang-builder:${{ matrix.go_version }}-base
13
+ env :
14
+ # Override Go 1.18 security deprecations.
15
+ GODEBUG : " x509sha1=1,tls10default=1"
12
16
steps :
13
- - uses : actions/checkout@v3
17
+ - name : Checkout repository
18
+ uses : actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
14
19
-
uses :
prometheus/[email protected]
15
20
- uses : ./.github/promci/actions/setup_environment
16
21
- run : make test
17
-
18
- golangci :
19
- name : golangci-lint
20
- runs-on : ubuntu-latest
21
- steps :
22
- - name : Checkout repository
23
- uses : actions/checkout@v3
24
- - name : Install Go
25
- uses : actions/setup-go@v3
26
- with :
27
- go-version : ' 1.20'
28
- - name : Lint
29
-
30
- with :
31
- version : v1.51.2
Original file line number Diff line number Diff line change
1
+ ---
2
+ # This action is synced from https://github.com/prometheus/prometheus
3
+ name : golangci-lint
4
+ on :
5
+ push :
6
+ paths :
7
+ - " go.sum"
8
+ - " go.mod"
9
+ - " **.go"
10
+ - " scripts/errcheck_excludes.txt"
11
+ - " .github/workflows/golangci-lint.yml"
12
+ - " .golangci.yml"
13
+ pull_request :
14
+
15
+ jobs :
16
+ golangci :
17
+ name : lint
18
+ runs-on : ubuntu-latest
19
+ steps :
20
+ - name : Checkout repository
21
+ uses : actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
22
+ - name : install Go
23
+ uses : actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 # v3.5.0
24
+ with :
25
+ go-version : 1.21.x
26
+ - name : Install snmp_exporter/generator dependencies
27
+ run : sudo apt-get update && sudo apt-get -y install libsnmp-dev
28
+ if : github.repository == 'prometheus/snmp_exporter'
29
+ - name : Lint
30
+ uses : golangci/golangci-lint-action@3a919529898de77ec3da873e3063ca4b10e7f5cc # v3.7.0
31
+ with :
32
+ version : v1.54.2
Original file line number Diff line number Diff line change @@ -17,4 +17,9 @@ linters-settings:
17
17
- (net/http.ResponseWriter).Write
18
18
# Never check for logger errors.
19
19
- (github.com/go-kit/log.Logger).Log
20
-
20
+ revive :
21
+ rules :
22
+ # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#unused-parameter
23
+ - name : unused-parameter
24
+ severity : warning
25
+ disabled : true
Original file line number Diff line number Diff line change 1
1
module github.com/prometheus/exporter-toolkit
2
2
3
- go 1.18
3
+ go 1.20
4
4
5
5
require (
6
6
github.com/alecthomas/kingpin/v2 v2.4.0
Original file line number Diff line number Diff line change @@ -18,15 +18,10 @@ package web
18
18
import (
19
19
weakrand "math/rand"
20
20
"sync"
21
- "time"
22
21
)
23
22
24
23
var cacheSize = 100
25
24
26
- func init () {
27
- weakrand .Seed (time .Now ().UnixNano ())
28
- }
29
-
30
25
type cache struct {
31
26
cache map [string ]bool
32
27
mtx sync.Mutex
You can’t perform that action at this time.
0 commit comments