linters: add httpstatus linter
This commit is contained in:
16
pkg/httpstatus/settings.go
Normal file
16
pkg/httpstatus/settings.go
Normal file
@@ -0,0 +1,16 @@
|
||||
package httpstatus
|
||||
|
||||
import "github.com/golangci/plugin-module-register/register"
|
||||
|
||||
type Settings struct {
|
||||
TypicalStatusCodes []int `json:"typical_status_codes"`
|
||||
IsRestricted bool `json:"restrict"`
|
||||
}
|
||||
|
||||
func decodeSettings(rawSettings any) (Settings, error) {
|
||||
if rawSettings == nil {
|
||||
return Settings{}, nil
|
||||
}
|
||||
|
||||
return register.DecodeSettings[Settings](rawSettings)
|
||||
}
|
||||
Reference in New Issue
Block a user