Skip to content

Commit

Permalink
Bump golangci-lint to v1.61.0 (#3135)
Browse files Browse the repository at this point in the history
* Bump golangci-lint to v1.61.0

* Fix golangci warnings
  • Loading branch information
gaby authored Sep 15, 2024
1 parent 37f1a65 commit 0ef8d71
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,4 @@ jobs:
uses: golangci/golangci-lint-action@v6
with:
# NOTE: Keep this in sync with the version from .golangci.yml
version: v1.60.3
version: v1.61.0
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ markdown:
## lint: 🚨 Run lint checks
.PHONY: lint
lint:
go run github.com/golangci/golangci-lint/cmd/golangci-lint@v1.60.3 run ./...
go run github.com/golangci/golangci-lint/cmd/golangci-lint@v1.61.0 run ./...

## test: 🚦 Execute all tests
.PHONY: test
Expand Down
4 changes: 2 additions & 2 deletions middleware/cache/cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ func New(config ...Config) fiber.Handler {
var (
// Cache settings
mux = &sync.RWMutex{}
timestamp = uint64(time.Now().Unix())
timestamp = uint64(time.Now().Unix()) //nolint:gosec //Not a concern
)
// Create manager to simplify storage operations ( see manager.go )
manager := newManager(cfg.Storage)
Expand All @@ -75,7 +75,7 @@ func New(config ...Config) fiber.Handler {
// Update timestamp in the configured interval
go func() {
for {
atomic.StoreUint64(&timestamp, uint64(time.Now().Unix()))
atomic.StoreUint64(&timestamp, uint64(time.Now().Unix())) //nolint:gosec //Not a concern
time.Sleep(timestampUpdatePeriod)
}
}()
Expand Down
2 changes: 1 addition & 1 deletion middleware/etag/etag.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ func New(config ...Config) fiber.Handler {
return c.SendStatus(fiber.StatusRequestEntityTooLarge)
}

bb.B = appendUint(bb.Bytes(), uint32(bodyLength)) //nolint:gosec // Body length is validated above
bb.B = appendUint(bb.Bytes(), uint32(bodyLength))
bb.WriteByte('-')
bb.B = appendUint(bb.Bytes(), crc32.Checksum(body, crc32q))
bb.WriteByte('"')
Expand Down

1 comment on commit 0ef8d71

@github-actions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Performance Alert ⚠️

Possible performance regression was detected for benchmark.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 1.50.

Benchmark suite Current: 0ef8d71 Previous: 6e74114 Ratio
Benchmark_Ctx_Send 7.456 ns/op 0 B/op 0 allocs/op 4.342 ns/op 0 B/op 0 allocs/op 1.72
Benchmark_Ctx_Send - ns/op 7.456 ns/op 4.342 ns/op 1.72
Benchmark_Utils_GetOffer/1_parameter 196.8 ns/op 0 B/op 0 allocs/op 131.1 ns/op 0 B/op 0 allocs/op 1.50
Benchmark_Utils_GetOffer/1_parameter - ns/op 196.8 ns/op 131.1 ns/op 1.50
Benchmark_Middleware_BasicAuth - B/op 80 B/op 48 B/op 1.67
Benchmark_Middleware_BasicAuth - allocs/op 5 allocs/op 3 allocs/op 1.67
Benchmark_Middleware_BasicAuth_Upper - B/op 80 B/op 48 B/op 1.67
Benchmark_Middleware_BasicAuth_Upper - allocs/op 5 allocs/op 3 allocs/op 1.67
Benchmark_CORS_NewHandler - B/op 16 B/op 0 B/op +∞
Benchmark_CORS_NewHandler - allocs/op 1 allocs/op 0 allocs/op +∞
Benchmark_CORS_NewHandlerSingleOrigin - B/op 16 B/op 0 B/op +∞
Benchmark_CORS_NewHandlerSingleOrigin - allocs/op 1 allocs/op 0 allocs/op +∞
Benchmark_CORS_NewHandlerPreflight - B/op 104 B/op 0 B/op +∞
Benchmark_CORS_NewHandlerPreflight - allocs/op 5 allocs/op 0 allocs/op +∞
Benchmark_CORS_NewHandlerPreflightSingleOrigin - B/op 104 B/op 0 B/op +∞
Benchmark_CORS_NewHandlerPreflightSingleOrigin - allocs/op 5 allocs/op 0 allocs/op +∞
Benchmark_CORS_NewHandlerPreflightWildcard 1042 ns/op 104 B/op 5 allocs/op 689.8 ns/op 0 B/op 0 allocs/op 1.51
Benchmark_CORS_NewHandlerPreflightWildcard - ns/op 1042 ns/op 689.8 ns/op 1.51
Benchmark_CORS_NewHandlerPreflightWildcard - B/op 104 B/op 0 B/op +∞
Benchmark_CORS_NewHandlerPreflightWildcard - allocs/op 5 allocs/op 0 allocs/op +∞
Benchmark_Middleware_CSRF_GenerateToken - B/op 513 B/op 334 B/op 1.54
Benchmark_Middleware_CSRF_GenerateToken - allocs/op 10 allocs/op 6 allocs/op 1.67

This comment was automatically generated by workflow using github-action-benchmark.

Please sign in to comment.