danderson / netboot

Packages and utilities for network booting
Apache License 2.0
1.48k stars 181 forks source link

Fix most of golangci-lint errors in the pixiecore package #100

Closed majst01 closed 4 years ago

majst01 commented 5 years ago

Hi @danderson

just stumbled over some golangci-lint issues in the pixiecore package, if you are interested please consider merging.

golangci-lint run |grep pixiecore
pixiecore/api-example/main.go:39:21: Error return value of `http.ListenAndServe` is not checked (errcheck)
pixiecore/boot_configuration.go:98:14: Error return value of `buf.ReadFrom` is not checked (errcheck)
pixiecore/booters_test.go:154:15: Error return value of `http.Serve` is not checked (errcheck)
pixiecore/cli/cli.go:86:24: Error return value of `(*github.com/spf13/pflag.FlagSet).MarkHidden` is not checked (errcheck)
pixiecore/http_test.go:37:5: `logSync` is unused (varcheck)
pixiecore/booters.go:260:3: ineffectual assignment to `sz` (ineffassign)
pixiecore/booters.go:286:12: ineffectual assignment to `err` (ineffassign)
pixiecore/booters.go:288:9: nilness: impossible condition: nil != nil (govet)
pixiecore/tftp.go:69:9: nilness: impossible condition: nil != nil (govet)
pixiecore/cli/bootipv6cmd.go:44:10: SA9003: empty branch (staticcheck)
pixiecore/cli/ipv6apicmd.go:45:10: SA9003: empty branch (staticcheck)
pixiecore/logging.go:104:18: U1000: func `(*Server).debugPacket` is unused (unused)
pixiecore/tftp.go:62:68: SA4009: argument err is overwritten before first use (staticcheck)