diff --git a/build.go b/build.go index f6359078..53deb51c 100644 --- a/build.go +++ b/build.go @@ -46,7 +46,7 @@ func (rb registerBuilder) applyBuildOptions(o *BuildOptions) { } // BuildWithBuilder registers a builder to build the NGINX configuration for the given directives. -func BuildWithBuilder(b Builder, directives ...string) RegisterBuilder { +func BuildWithBuilder(b Builder, directives ...string) RegisterBuilder { //nolint:ireturn return registerBuilder{b: b, directives: directives} } diff --git a/lex.go b/lex.go index 8ec40bb0..3521eaa2 100644 --- a/lex.go +++ b/lex.go @@ -84,7 +84,7 @@ func (rl registerLexer) applyLexOptions(o *LexOptions) { // LexWithLexer registers a Lexer that implements tokenization of an NGINX configuration after one of the given // stringTokens is encountered by Lex. -func LexWithLexer(l Lexer, stringTokens ...string) RegisterLexer { +func LexWithLexer(l Lexer, stringTokens ...string) RegisterLexer { //nolint:ireturn return registerLexer{l: l, stringTokens: stringTokens} } diff --git a/lex_test.go b/lex_test.go index 31a3375b..cb3c5148 100644 --- a/lex_test.go +++ b/lex_test.go @@ -430,7 +430,6 @@ func TestLex(t *testing.T) { } defer file.Close() - lua := &Lua{} options := LexOptions{ Lexers: []RegisterLexer{lua.RegisterLexer()}, } diff --git a/lua.go b/lua.go index 8a77880d..a3a65222 100644 --- a/lua.go +++ b/lua.go @@ -28,7 +28,7 @@ func (l *Lua) directiveNames() []string { } } -func (l *Lua) RegisterLexer() RegisterLexer { +func (l *Lua) RegisterLexer() RegisterLexer { //nolint:ireturn return LexWithLexer(l, l.directiveNames()...) } @@ -150,7 +150,7 @@ func (l *Lua) Lex(s *SubScanner, matchedToken string) <-chan NgxToken { return tokenCh } -func (l *Lua) RegisterBuilder() RegisterBuilder { +func (l *Lua) RegisterBuilder() RegisterBuilder { //nolint:ireturn return BuildWithBuilder(l, l.directiveNames()...) } diff --git a/parse_test.go b/parse_test.go index 65a44ca9..01506bb7 100644 --- a/parse_test.go +++ b/parse_test.go @@ -43,6 +43,7 @@ func getTestConfigPath(parts ...string) string { return filepath.Join("testdata", "configs", filepath.Join(parts...)) } +//nolint:gochecknoglobals var lua = &Lua{} //nolint:gochecknoglobals,exhaustruct