Skip to content

Commit

Permalink
fix linter warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
equinox0815 committed Jan 19, 2025
1 parent a42bda8 commit e4ebef7
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 12 deletions.
2 changes: 1 addition & 1 deletion cmd/whawty-auth/hooks.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ func runHook(executeable, store string) {
select {
case <-t.C:
wl.Printf("Hooks: killing long running hook '%s'", executeable)
cmd.Process.Kill()
cmd.Process.Kill() //nolint:errcheck
case err := <-exited:
if err != nil {
wl.Printf("Hooks: '%s': %v", executeable, err)
Expand Down
10 changes: 5 additions & 5 deletions cmd/whawty-auth/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ func askPass() (string, error) {
func cmdInit(c *cli.Context) error {
username := c.Args().First()
if username == "" {
cli.ShowCommandHelp(c, "init")
cli.ShowCommandHelp(c, "init") //nolint:errcheck
return cli.NewExitError("", 0)
}

Expand Down Expand Up @@ -147,7 +147,7 @@ func cmdAdd(c *cli.Context) error {

username := c.Args().First()
if username == "" {
cli.ShowCommandHelp(c, "add")
cli.ShowCommandHelp(c, "add") //nolint:errcheck
return cli.NewExitError("", 0)
}

Expand Down Expand Up @@ -177,7 +177,7 @@ func cmdRemove(c *cli.Context) error {

username := c.Args().First()
if username == "" {
cli.ShowCommandHelp(c, "remove")
cli.ShowCommandHelp(c, "remove") //nolint:errcheck
return cli.NewExitError("", 0)
}

Expand All @@ -195,7 +195,7 @@ func cmdUpdate(c *cli.Context) error {

username := c.Args().First()
if username == "" {
cli.ShowCommandHelp(c, "update")
cli.ShowCommandHelp(c, "update") //nolint:errcheck
return cli.NewExitError("", 0)
}

Expand Down Expand Up @@ -689,5 +689,5 @@ func main() {
}

wdl.Printf("calling app.Run()")
app.Run(os.Args)
app.Run(os.Args) //nolint:errcheck
}
5 changes: 2 additions & 3 deletions cmd/whawty-auth/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -243,9 +243,8 @@ func (s *store) listFull() (result listFullResult) {
}

func (s *store) authenticate(username, password string) (result authenticateResult) {
var upgradeable bool
result.ok, result.isAdmin, upgradeable, result.lastChanged, result.err = s.dir.Authenticate(username, password)
if result.ok && upgradeable && s.upgradeChan != nil {
result.ok, result.isAdmin, result.upgradeable, result.lastChanged, result.err = s.dir.Authenticate(username, password)
if result.ok && result.upgradeable && s.upgradeChan != nil {
s.upgradeChan <- updateRequest{username: username, password: password}
}
return
Expand Down
4 changes: 2 additions & 2 deletions cmd/whawty-auth/web_api.go
Original file line number Diff line number Diff line change
Expand Up @@ -494,8 +494,8 @@ func (ln tcpKeepAliveListener) Accept() (c net.Conn, err error) {
if err != nil {
return
}
tc.SetKeepAlive(true)
tc.SetKeepAlivePeriod(3 * time.Minute)
tc.SetKeepAlive(true) //nolint:errcheck
tc.SetKeepAlivePeriod(3 * time.Minute) //nolint:errcheck
return tc, nil
}

Expand Down
2 changes: 1 addition & 1 deletion sasl/sasl.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ func (s *Server) handleConnection(conn net.Conn) {
}
}

resp.Encode(conn) // silently drop error...
resp.Encode(conn) //nolint:errcheck
}

// Run actually runs the server. In calls Accept() on the server socket and
Expand Down

0 comments on commit e4ebef7

Please sign in to comment.