Skip to content

Commit

Permalink
1599 update and fix linter
Browse files Browse the repository at this point in the history
  • Loading branch information
mr-nick17 committed May 10, 2023
1 parent 79ab050 commit 2cc26ff
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 9 deletions.
8 changes: 4 additions & 4 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ linters:
# inverted configuration with `enable-all` and `disable` is not scalable during updates of golangci-lint
disable-all: true
enable:
- deadcode
- depguard
- dogsled
- gochecknoinits
Expand All @@ -64,7 +63,6 @@ linters:
- ineffassign
- nakedret
- unconvert
- varcheck
- whitespace
- gocognit
- prealloc
Expand All @@ -82,12 +80,14 @@ issues:
- gocritic
- ineffassign
- govet
- path: main.go
linters:
- typecheck
new: false

# golangci.com configuration
# https://github.com/golangci/golangci/wiki/Configuration
service:
golangci-lint-version: 1.43.x # use the fixed version to not introduce new linters unexpectedly
golangci-lint-version: 1.52.x # use the fixed version to not introduce new linters unexpectedly
prepare:
- echo "here I can run custom commands, but no preparation needed for this repo"
- echo "here I can run custom commands, but no preparation needed for this repo"
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@ audit:
build: generate-prod
go build -tags 'production' $(LDFLAGS) -o $(BINPATH)/dp-frontend-feedback-controller

.PHONY: lint
lint:
go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.45.2
go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.52.2
golangci-lint run ./...

.PHONY: debug
Expand Down
4 changes: 2 additions & 2 deletions handlers/feedback.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ func (f *Feedback) FeedbackThanks() http.HandlerFunc {
})
}

func feedbackThanks(w http.ResponseWriter, req *http.Request, url string, rend interfaces.Renderer, cacheHelperService *cacheHelper.Helper, lang string) {
func feedbackThanks(w http.ResponseWriter, req *http.Request, uri string, rend interfaces.Renderer, cacheHelperService *cacheHelper.Helper, lang string) {
ctx := req.Context()
var wholeSite string

Expand All @@ -40,7 +40,7 @@ func feedbackThanks(w http.ResponseWriter, req *http.Request, url string, rend i
}

basePage := rend.NewBasePageModel()
p := mapper.CreateGetFeedbackThanks(req, basePage, lang, url, wholeSite)
p := mapper.CreateGetFeedbackThanks(req, basePage, lang, uri, wholeSite)

if cfg.EnableNewNavBar {
mappedNavContent, err := cacheHelperService.GetMappedNavigationContent(ctx, lang)
Expand Down
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ func main() {
cacheService, err := cacheHelper.Init(ctx, cacheConfig)
cacheService.RunUpdates(ctx, svcErrors)

// nolint: typecheck
//nolint:typecheck
rend := render.NewWithDefaultClient(assets.Asset, assets.AssetNames, cfg.PatternLibraryAssetsPath, cfg.SiteDomain)

routes.Setup(ctx, r, cfg, rend, healthcheck, cacheService)
Expand Down
2 changes: 1 addition & 1 deletion mocks/mocks.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@ var enLocale = []string{
}

// MockAssetFunction returns mocked toml []bytes
func MockAssetFunction(name string) ([]byte, error) {
func MockAssetFunction(name string) ([]byte, error) { //nolint:all // app does not use welsh
return []byte(strings.Join(enLocale, "\n")), nil
}

0 comments on commit 2cc26ff

Please sign in to comment.