Skip to content

resolcing linter complaints #96

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion build.go
Original file line number Diff line number Diff line change
Expand Up @@ -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}
}

Expand Down
2 changes: 1 addition & 1 deletion lex.go
Original file line number Diff line number Diff line change
Expand Up @@ -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}
}

Expand Down
1 change: 0 additions & 1 deletion lex_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,6 @@ func TestLex(t *testing.T) {
}
defer file.Close()

lua := &Lua{}
options := LexOptions{
Lexers: []RegisterLexer{lua.RegisterLexer()},
}
Expand Down
4 changes: 2 additions & 2 deletions lua.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()...)
}

Expand Down Expand Up @@ -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()...)
}

Expand Down
1 change: 1 addition & 0 deletions parse_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down