Linting and staticcheck fixes. (#101)
* Fix linting and staticcheck issues * Add changelog update * Remove SetNext
This commit is contained in:
parent
18cd8a66a2
commit
f29a200f09
6 changed files with 13 additions and 17 deletions
|
@ -51,7 +51,7 @@ func (b BotConfig) Valid() error {
|
|||
errs = append(errs, ErrBotMustHaveName)
|
||||
}
|
||||
|
||||
if b.UserAgentRegex == nil && b.PathRegex == nil && (b.RemoteAddr == nil || len(b.RemoteAddr) == 0) {
|
||||
if b.UserAgentRegex == nil && b.PathRegex == nil && len(b.RemoteAddr) == 0 {
|
||||
errs = append(errs, ErrBotMustHaveUserAgentOrPath)
|
||||
}
|
||||
|
||||
|
@ -71,7 +71,7 @@ func (b BotConfig) Valid() error {
|
|||
}
|
||||
}
|
||||
|
||||
if b.RemoteAddr != nil && len(b.RemoteAddr) > 0 {
|
||||
if len(b.RemoteAddr) > 0 {
|
||||
for _, cidr := range b.RemoteAddr {
|
||||
if _, _, err := net.ParseCIDR(cidr); err != nil {
|
||||
errs = append(errs, ErrInvalidCIDR, err)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue