Skip to content

Commit

Permalink
fixed headers; ignore cyclo of newconfig; faster linting
Browse files Browse the repository at this point in the history
Signed-off-by: hfuss <[email protected]>
  • Loading branch information
onelapahead committed Jan 15, 2025
1 parent 1d3ce59 commit e8df07b
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ coverage.html:
$(VGO) tool cover -html=coverage.txt
coverage: test coverage.html
lint: ${LINT}
GOGC=20 $(LINT) run -v --timeout 5m
GOGC=20 $(LINT) run -v --timeout 5m --fast --allow-parallel-runners
${MOCKERY}:
$(VGO) install github.com/vektra/mockery/v2@latest
${LINT}:
Expand Down
7 changes: 3 additions & 4 deletions pkg/ffresty/ffresty.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright © 2024 Kaleido, Inc.
// Copyright © 2025 Kaleido, Inc.
//
// SPDX-License-Identifier: Apache-2.0
//
Expand Down Expand Up @@ -198,7 +198,7 @@ func GetRateLimiter(rps, burst int) *rate.Limiter {
//
// You can use the normal Resty builder pattern, to set per-instance configuration
// as required.
func NewWithConfig(ctx context.Context, ffrestyConfig Config) (client *resty.Client) {
func NewWithConfig(ctx context.Context, ffrestyConfig Config) (client *resty.Client) { //nolint:gocyclo
if ffrestyConfig.HTTPCustomClient != nil {
if httpClient, ok := ffrestyConfig.HTTPCustomClient.(*http.Client); ok {
client = resty.NewWithClient(httpClient)
Expand Down Expand Up @@ -259,6 +259,7 @@ func NewWithConfig(ctx context.Context, ffrestyConfig Config) (client *resty.Cli
}
rCtx := req.Context()
// Record host in context to avoid redundant parses in hooks
rCtx = context.WithValue(rCtx, hostCtxKey{}, "unknown")
var u *url.URL
if req.URL != "" {
u, _ = url.Parse(req.URL)
Expand All @@ -275,8 +276,6 @@ func NewWithConfig(ctx context.Context, ffrestyConfig Config) (client *resty.Cli
if u != nil && u.Host != "" {
host := u.Host
rCtx = context.WithValue(rCtx, hostCtxKey{}, host)
} else {
rCtx = context.WithValue(rCtx, hostCtxKey{}, "unknown")
}
rc := rCtx.Value(retryCtxKey{})
if rc == nil {
Expand Down
2 changes: 1 addition & 1 deletion pkg/ffresty/ffresty_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright © 2024 Kaleido, Inc.
// Copyright © 2025 Kaleido, Inc.
//
// SPDX-License-Identifier: Apache-2.0
//
Expand Down
2 changes: 1 addition & 1 deletion pkg/metric/metric_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright © 2023 Kaleido, Inc.
// Copyright © 2025 Kaleido, Inc.
//
// SPDX-License-Identifier: Apache-2.0
//
Expand Down
2 changes: 1 addition & 1 deletion pkg/metric/prometheusMetricsManager.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright © 2024 Kaleido, Inc.
// Copyright © 2025 Kaleido, Inc.
//
// SPDX-License-Identifier: Apache-2.0
//
Expand Down

0 comments on commit e8df07b

Please sign in to comment.