chore: linter: staticcheck
Signed-off-by: Jakob Borg <jakob@kastelo.net>
This commit is contained in:
@@ -10,7 +10,7 @@ import (
|
|||||||
func setTCPOptions(conn net.Conn) error {
|
func setTCPOptions(conn net.Conn) error {
|
||||||
tcpConn, ok := conn.(*net.TCPConn)
|
tcpConn, ok := conn.(*net.TCPConn)
|
||||||
if !ok {
|
if !ok {
|
||||||
return errors.New("Not a TCP connection")
|
return errors.New("not a TCP connection")
|
||||||
}
|
}
|
||||||
if err := tcpConn.SetLinger(0); err != nil {
|
if err := tcpConn.SetLinger(0); err != nil {
|
||||||
return err
|
return err
|
||||||
|
|||||||
@@ -91,11 +91,11 @@ func loadGUIConfig() (config.GUIConfiguration, error) {
|
|||||||
guiCfg := cfg.GUI()
|
guiCfg := cfg.GUI()
|
||||||
|
|
||||||
if guiCfg.Address() == "" {
|
if guiCfg.Address() == "" {
|
||||||
return config.GUIConfiguration{}, errors.New("Could not find GUI Address")
|
return config.GUIConfiguration{}, errors.New("could not find GUI Address")
|
||||||
}
|
}
|
||||||
|
|
||||||
if guiCfg.APIKey == "" {
|
if guiCfg.APIKey == "" {
|
||||||
return config.GUIConfiguration{}, errors.New("Could not find GUI API key")
|
return config.GUIConfiguration{}, errors.New("could not find GUI API key")
|
||||||
}
|
}
|
||||||
|
|
||||||
return guiCfg, nil
|
return guiCfg, nil
|
||||||
|
|||||||
@@ -254,15 +254,9 @@ func readTarGz(archiveName, dir string, r io.Reader) (string, error) {
|
|||||||
var sig []byte
|
var sig []byte
|
||||||
|
|
||||||
// Iterate through the files in the archive.
|
// Iterate through the files in the archive.
|
||||||
i := 0
|
for range maxArchiveMembers {
|
||||||
for {
|
|
||||||
if i >= maxArchiveMembers {
|
|
||||||
break
|
|
||||||
}
|
|
||||||
i++
|
|
||||||
|
|
||||||
hdr, err := tr.Next()
|
hdr, err := tr.Next()
|
||||||
if err == io.EOF {
|
if errors.Is(err, io.EOF) {
|
||||||
// end of tar archive
|
// end of tar archive
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user