Skip to content

Commit 8c78b40

Browse files
authored
Merge pull request #195 from slok/slok/update-deps
2 parents cda1880 + a4a12a1 commit 8c78b40

File tree

20 files changed

+322
-533
lines changed

20 files changed

+322
-533
lines changed

.github/workflows/ci.yml

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,28 +7,34 @@ jobs:
77
name: Check
88
runs-on: ubuntu-latest
99
# Execute the checks inside the container instead the VM.
10-
container: golangci/golangci-lint:v1.31.0-alpine
10+
container: golangci/golangci-lint:v1.54.2-alpine
1111
steps:
12-
- uses: actions/[email protected]
13-
- run: golangci-lint run -E goimports
12+
- uses: actions/checkout@v4
13+
- run: |
14+
# We need this go flag because it started to error after golangci-lint is using Go 1.21.
15+
# TODO(slok): Remove it on next (>1.54.2) golangci-lint upgrade to check if this problem has gone.
16+
export GOFLAGS="-buildvcs=false"
17+
golangci-lint run
1418
1519
unit-test:
1620
name: Unit test
1721
runs-on: ubuntu-latest
1822
steps:
19-
- uses: actions/checkout@v3.0.2
20-
- uses: actions/setup-go@v3.2.0
23+
- uses: actions/checkout@v4
24+
- uses: actions/setup-go@v4
2125
with:
22-
go-version: 1.17
26+
go-version-file: go.mod
27+
cache: false
2328
- run: make test
2429

2530
integration-test:
2631
name: Integration test
2732
runs-on: ubuntu-latest
2833
needs: [check, unit-test]
2934
steps:
30-
- uses: actions/checkout@v3.0.2
31-
- uses: actions/setup-go@v3.2.0
35+
- uses: actions/checkout@v4
36+
- uses: actions/setup-go@v4
3237
with:
33-
go-version: 1.17
38+
go-version-file: go.mod
39+
cache: false
3440
- run: make integration-test

.golangci.yml

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,21 @@
11
---
2-
32
run:
3+
timeout: 3m
44
build-tags:
55
- integration
6+
7+
linters:
8+
enable:
9+
- misspell
10+
- goimports
11+
- revive
12+
- gofmt
13+
#- depguard
14+
- godot
15+
16+
linters-settings:
17+
revive:
18+
rules:
19+
# Spammy linter and complex to fix on lots of parameters. Makes more harm that it solves.
20+
- name: unused-parameter
21+
disabled: true

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
## [Unreleased]
44

5+
### Changed
6+
7+
- Update dependencies to latest versions.
8+
59
### Added
610

711
- Support Iris library.

Makefile

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ UNIT_TEST_CMD := go test `go list ./... | grep -v test\/integration` -race -c
33
go tool cover -func=.test_coverage.txt | tail -n1 | awk '{print "Total test coverage: " $$3}'
44
INTEGRATION_TEST_CMD := go test ./test/integration -race
55
BENCHMARK_CMD := go test `go list ./...` -benchmem -bench=.
6-
CHECK_CMD := golangci-lint run -E goimports
6+
CHECK_CMD := golangci-lint run
77
DEPS_CMD := go mod tidy
88
MOCKS_CMD := go generate ./internal/mocks
99

@@ -23,8 +23,8 @@ unit-test: ## Execute unit tests.
2323
integration-test: ## Execute unit tests.
2424
$(INTEGRATION_TEST_CMD)
2525

26-
.PHONY: test ## Alias for unit tests.
27-
test: unit-test
26+
.PHONY: test
27+
test: unit-test ## Alias for unit tests.
2828

2929
.PHONY: benchmark
3030
benchmark: ## Execute benchmarks.
@@ -45,3 +45,4 @@ mocks: ## Generates mocks.
4545
.PHONY: docs
4646
docs: ## Runs docs example on :6060.
4747
godoc -http=":6060"
48+

doc.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
Package gohttpmetrics knows how to measure http metrics in different metric formats,
33
it comes with a middleware that can be used for different frameworks and also the
44
the main Go net/http handler:
5+
56
package main
67
78
import (

examples/chi/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import (
88
"syscall"
99
"time"
1010

11-
"github.com/go-chi/chi"
11+
"github.com/go-chi/chi/v4"
1212
"github.com/prometheus/client_golang/prometheus/promhttp"
1313
metrics "github.com/slok/go-http-metrics/metrics/prometheus"
1414
"github.com/slok/go-http-metrics/middleware"

go.mod

Lines changed: 66 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -1,97 +1,103 @@
11
module github.com/slok/go-http-metrics
22

3+
go 1.21
4+
35
require (
4-
contrib.go.opencensus.io/exporter/prometheus v0.4.0
5-
github.com/emicklei/go-restful/v3 v3.8.0
6-
github.com/fasthttp/router v1.4.6
7-
github.com/gin-gonic/gin v1.8.1
8-
github.com/go-chi/chi v4.1.2+incompatible
6+
contrib.go.opencensus.io/exporter/prometheus v0.4.2
7+
github.com/emicklei/go-restful/v3 v3.11.0
8+
github.com/fasthttp/router v1.4.21
9+
github.com/gin-gonic/gin v1.9.1
10+
github.com/go-chi/chi/v4 v4.1.3
911
github.com/gorilla/mux v1.8.0
1012
github.com/julienschmidt/httprouter v1.3.0
1113
github.com/justinas/alice v1.2.0
12-
github.com/kataras/iris/v12 v12.2.0-beta3
13-
github.com/labstack/echo/v4 v4.7.2
14-
github.com/prometheus/client_golang v1.12.2
15-
github.com/stretchr/testify v1.7.5
14+
github.com/kataras/iris/v12 v12.2.7
15+
github.com/labstack/echo/v4 v4.11.2
16+
github.com/prometheus/client_golang v1.17.0
17+
github.com/stretchr/testify v1.8.4
1618
github.com/urfave/negroni v1.0.0
17-
github.com/valyala/fasthttp v1.37.0
18-
go.opencensus.io v0.23.0
19+
github.com/valyala/fasthttp v1.50.0
20+
go.opencensus.io v0.24.0
1921
goji.io v2.0.2+incompatible
2022
)
2123

2224
require (
23-
github.com/BurntSushi/toml v1.1.0 // indirect
25+
github.com/BurntSushi/toml v1.3.2 // indirect
2426
github.com/CloudyKit/fastprinter v0.0.0-20200109182630-33d98a066a53 // indirect
25-
github.com/CloudyKit/jet/v6 v6.1.0 // indirect
26-
github.com/Shopify/goreferrer v0.0.0-20210630161223-536fa16abd6f // indirect
27-
github.com/andybalholm/brotli v1.0.4 // indirect
27+
github.com/CloudyKit/jet/v6 v6.2.0 // indirect
28+
github.com/Joker/jade v1.1.3 // indirect
29+
github.com/Shopify/goreferrer v0.0.0-20220729165902-8cddb4f5de06 // indirect
30+
github.com/andybalholm/brotli v1.0.6 // indirect
2831
github.com/aymerick/douceur v0.2.0 // indirect
2932
github.com/beorn7/perks v1.0.1 // indirect
30-
github.com/cespare/xxhash/v2 v2.1.2 // indirect
33+
github.com/bytedance/sonic v1.9.1 // indirect
34+
github.com/cespare/xxhash/v2 v2.2.0 // indirect
35+
github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311 // indirect
3136
github.com/davecgh/go-spew v1.1.1 // indirect
32-
github.com/eknkc/amber v0.0.0-20171010120322-cdade1c07385 // indirect
3337
github.com/fatih/structs v1.1.0 // indirect
3438
github.com/flosch/pongo2/v4 v4.0.2 // indirect
39+
github.com/gabriel-vasile/mimetype v1.4.2 // indirect
3540
github.com/gin-contrib/sse v0.1.0 // indirect
36-
github.com/go-kit/log v0.1.0 // indirect
37-
github.com/go-logfmt/logfmt v0.5.0 // indirect
38-
github.com/go-playground/locales v0.14.0 // indirect
39-
github.com/go-playground/universal-translator v0.18.0 // indirect
40-
github.com/go-playground/validator/v10 v10.10.0 // indirect
41-
github.com/goccy/go-json v0.9.8-0.20220506185958-23bd66f4c0d5 // indirect
41+
github.com/go-kit/log v0.2.1 // indirect
42+
github.com/go-logfmt/logfmt v0.6.0 // indirect
43+
github.com/go-playground/locales v0.14.1 // indirect
44+
github.com/go-playground/universal-translator v0.18.1 // indirect
45+
github.com/go-playground/validator/v10 v10.15.5 // indirect
46+
github.com/goccy/go-json v0.10.2 // indirect
4247
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
43-
github.com/golang/protobuf v1.5.2 // indirect
4448
github.com/golang/snappy v0.0.4 // indirect
45-
github.com/google/uuid v1.3.0 // indirect
49+
github.com/gomarkdown/markdown v0.0.0-20230922112808-5421fefb8386 // indirect
50+
github.com/google/uuid v1.3.1 // indirect
4651
github.com/gorilla/css v1.0.0 // indirect
47-
github.com/iris-contrib/jade v1.1.4 // indirect
4852
github.com/iris-contrib/schema v0.0.6 // indirect
4953
github.com/josharian/intern v1.0.0 // indirect
5054
github.com/json-iterator/go v1.1.12 // indirect
51-
github.com/kataras/blocks v0.0.5 // indirect
52-
github.com/kataras/golog v0.1.7 // indirect
53-
github.com/kataras/pio v0.0.10 // indirect
54-
github.com/kataras/sitemap v0.0.5 // indirect
55+
github.com/kataras/blocks v0.0.8 // indirect
56+
github.com/kataras/golog v0.1.9 // indirect
57+
github.com/kataras/pio v0.0.12 // indirect
58+
github.com/kataras/sitemap v0.0.6 // indirect
5559
github.com/kataras/tunnel v0.0.4 // indirect
56-
github.com/klauspost/compress v1.15.5 // indirect
57-
github.com/labstack/gommon v0.3.1 // indirect
58-
github.com/leodido/go-urn v1.2.1 // indirect
59-
github.com/mailgun/raymond/v2 v2.0.46 // indirect
60+
github.com/klauspost/compress v1.17.1 // indirect
61+
github.com/klauspost/cpuid/v2 v2.2.4 // indirect
62+
github.com/labstack/gommon v0.4.0 // indirect
63+
github.com/leodido/go-urn v1.2.4 // indirect
64+
github.com/mailgun/raymond/v2 v2.0.48 // indirect
6065
github.com/mailru/easyjson v0.7.7 // indirect
61-
github.com/mattn/go-colorable v0.1.12 // indirect
62-
github.com/mattn/go-isatty v0.0.14 // indirect
63-
github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect
64-
github.com/microcosm-cc/bluemonday v1.0.18 // indirect
66+
github.com/mattn/go-colorable v0.1.13 // indirect
67+
github.com/mattn/go-isatty v0.0.20 // indirect
68+
github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0 // indirect
69+
github.com/microcosm-cc/bluemonday v1.0.26 // indirect
6570
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
6671
github.com/modern-go/reflect2 v1.0.2 // indirect
67-
github.com/pelletier/go-toml/v2 v2.0.1 // indirect
72+
github.com/pelletier/go-toml/v2 v2.1.0 // indirect
6873
github.com/pmezard/go-difflib v1.0.0 // indirect
69-
github.com/prometheus/client_model v0.2.0 // indirect
70-
github.com/prometheus/common v0.32.1 // indirect
71-
github.com/prometheus/procfs v0.7.3 // indirect
72-
github.com/prometheus/statsd_exporter v0.21.0 // indirect
74+
github.com/prometheus/client_model v0.5.0 // indirect
75+
github.com/prometheus/common v0.45.0 // indirect
76+
github.com/prometheus/procfs v0.12.0 // indirect
77+
github.com/prometheus/statsd_exporter v0.24.0 // indirect
7378
github.com/russross/blackfriday/v2 v2.1.0 // indirect
74-
github.com/savsgio/gotils v0.0.0-20211223103454-d0aaa54c5899 // indirect
79+
github.com/savsgio/gotils v0.0.0-20230208104028-c358bd845dee // indirect
7580
github.com/schollz/closestmatch v2.1.0+incompatible // indirect
76-
github.com/sirupsen/logrus v1.8.1 // indirect
77-
github.com/stretchr/objx v0.4.0 // indirect
78-
github.com/tdewolff/minify/v2 v2.11.7 // indirect
79-
github.com/tdewolff/parse/v2 v2.5.32 // indirect
80-
github.com/ugorji/go/codec v1.2.7 // indirect
81+
github.com/sirupsen/logrus v1.9.3 // indirect
82+
github.com/stretchr/objx v0.5.1 // indirect
83+
github.com/tdewolff/minify/v2 v2.12.9 // indirect
84+
github.com/tdewolff/parse/v2 v2.6.8 // indirect
85+
github.com/twitchyliquid64/golang-asm v0.15.1 // indirect
86+
github.com/ugorji/go/codec v1.2.11 // indirect
8187
github.com/valyala/bytebufferpool v1.0.0 // indirect
82-
github.com/valyala/fasttemplate v1.2.1 // indirect
83-
github.com/vmihailenco/msgpack/v5 v5.3.5 // indirect
88+
github.com/valyala/fasttemplate v1.2.2 // indirect
89+
github.com/vmihailenco/msgpack/v5 v5.4.0 // indirect
8490
github.com/vmihailenco/tagparser/v2 v2.0.0 // indirect
8591
github.com/yosssi/ace v0.0.5 // indirect
86-
golang.org/x/crypto v0.0.0-20220507011949-2cf3adece122 // indirect
87-
golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4 // indirect
88-
golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6 // indirect
89-
golang.org/x/text v0.3.7 // indirect
90-
golang.org/x/time v0.0.0-20220411224347-583f2d630306 // indirect
91-
google.golang.org/protobuf v1.28.0 // indirect
92-
gopkg.in/ini.v1 v1.66.6 // indirect
92+
golang.org/x/arch v0.3.0 // indirect
93+
golang.org/x/crypto v0.14.0 // indirect
94+
golang.org/x/exp v0.0.0-20230905200255-921286631fa9 // indirect
95+
golang.org/x/net v0.17.0 // indirect
96+
golang.org/x/sys v0.13.0 // indirect
97+
golang.org/x/text v0.13.0 // indirect
98+
golang.org/x/time v0.3.0 // indirect
99+
google.golang.org/protobuf v1.31.0 // indirect
100+
gopkg.in/ini.v1 v1.67.0 // indirect
93101
gopkg.in/yaml.v2 v2.4.0 // indirect
94102
gopkg.in/yaml.v3 v3.0.1 // indirect
95103
)
96-
97-
go 1.17

0 commit comments

Comments
 (0)