Skip to content

Commit

Permalink
Skip explicit struct fields
Browse files Browse the repository at this point in the history
  • Loading branch information
applejag committed Jun 10, 2024
1 parent 4b0156b commit f4f4d93
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
1 change: 1 addition & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ linters:
- gomnd
- forbidigo
- varnamelen
- exhaustivestruct

issues:
exclude-use-default: false
Expand Down
8 changes: 2 additions & 6 deletions plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,7 @@ type ConfigHeaders struct {
// CreateConfig creates the default plugin configuration.
func CreateConfig() *Config {
return &Config{
Headers: ConfigHeaders{
Port: "",
IP: "",
Address: "",
},
Headers: ConfigHeaders{},
}
}

Expand All @@ -48,7 +44,7 @@ type RemoteAddrPlugin struct {

// New created a new RemoteAddrPlugin.
func New(_ context.Context, next http.Handler, config *Config, name string) (http.Handler, error) {
if config.Headers == (ConfigHeaders{Port: "", IP: "", Address: ""}) {
if config.Headers == (ConfigHeaders{}) {
return nil, errMissingHeaderConfig
}

Expand Down

0 comments on commit f4f4d93

Please sign in to comment.