From 13a63bc99e96bdb619503c247e67b4a220f8c9a2 Mon Sep 17 00:00:00 2001 From: Fernandez Ludovic Date: Sat, 16 Nov 2024 16:37:06 +0100 Subject: [PATCH] review: fix naming --- analyzer.go | 6 +++--- analyzer_test.go | 2 +- cmd/recvcheck/main.go | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/analyzer.go b/analyzer.go index c921e6d..96bf637 100644 --- a/analyzer.go +++ b/analyzer.go @@ -9,7 +9,7 @@ import ( ) // NewAnalyzer returns a new analyzer to check for receiver type consistency. -func NewAnalyzer(s Setting) *analysis.Analyzer { +func NewAnalyzer(s Settings) *analysis.Analyzer { // Default excludes for Marshal/Encode methods https://github.com/raeperd/recvcheck/issues/7 excludedMethods := map[string]struct{}{ "MarshalText": {}, @@ -34,8 +34,8 @@ func NewAnalyzer(s Setting) *analysis.Analyzer { } } -// Setting is the configuration for the analyzer. -type Setting struct { +// Settings is the configuration for the analyzer. +type Settings struct { // DisableBuiltin if true, disables the built-in method excludes. // Built-in excluded methods: // - "MarshalText" diff --git a/analyzer_test.go b/analyzer_test.go index e8f17d5..e09cc14 100644 --- a/analyzer_test.go +++ b/analyzer_test.go @@ -8,5 +8,5 @@ import ( ) func TestAnalyzer(t *testing.T) { - analysistest.Run(t, analysistest.TestData(), recvcheck.NewAnalyzer(recvcheck.Setting{}), "test") + analysistest.Run(t, analysistest.TestData(), recvcheck.NewAnalyzer(recvcheck.Settings{}), "test") } diff --git a/cmd/recvcheck/main.go b/cmd/recvcheck/main.go index 029e4ed..c23dd89 100644 --- a/cmd/recvcheck/main.go +++ b/cmd/recvcheck/main.go @@ -14,7 +14,7 @@ func main() { flag.BoolVar(&noBuiltinExcludeMethod, "no-builtin-exclude-method", false, `disables the default exclude methods such as "MarshalJSON"`) - setting := recvcheck.Setting{ + setting := recvcheck.Settings{ DisableBuiltin: noBuiltinExcludeMethod, } singlechecker.Main(recvcheck.NewAnalyzer(setting))