From d256f0ecf10c608d7422dd719528856a478aa0bc Mon Sep 17 00:00:00 2001 From: Andrew Nesbitt Date: Fri, 22 May 2026 11:33:39 +0100 Subject: [PATCH 1/2] Set goconst to ignore test files Path exclusions only filter where goconst issues are reported, not which files contribute to the occurrence count, so a string used once in production code and twice in tests still gets flagged. The `ignore-tests` setting makes goconst skip test files entirely. --- .golangci.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.golangci.yml b/.golangci.yml index 366252d..4020087 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -3,3 +3,8 @@ version: "2" formatters: enable: - gofmt + +linters: + settings: + goconst: + ignore-tests: true From 91e3f9d2fee73739a01f3fb0cc6407e62b0d2013 Mon Sep 17 00:00:00 2001 From: Andrew Nesbitt Date: Fri, 22 May 2026 11:52:04 +0100 Subject: [PATCH 2/2] Replace deprecated reflect.Ptr with reflect.Pointer --- cmd/brief/main.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/brief/main.go b/cmd/brief/main.go index 0088f82..df06d3f 100644 --- a/cmd/brief/main.go +++ b/cmd/brief/main.go @@ -324,7 +324,7 @@ func cmdSchema() { // Named struct types are emitted as $ref pointers into the $defs map. func schemaForType(t reflect.Type, defs map[string]any) map[string]any { // Unwrap pointers. - for t.Kind() == reflect.Ptr { + for t.Kind() == reflect.Pointer { t = t.Elem() }