rtr7 / router7

router7 is a small home internet router completely written in Go. It is implemented as a gokrazy appliance.
https://router7.org
Apache License 2.0
2.69k stars 110 forks source link

staticcheck issues #42

Closed mdlayher closed 4 years ago

mdlayher commented 4 years ago

Hey @stapelberg! Hello from my Twitch stream! :)

Just ran staticcheck and noticed some issues on the repo, and wanted to let you know!

$ staticcheck ./...
cmd/dhcp4d/dhcp4d.go:390:4: this value of b is never used (SA4006)
integration/radvd/radvd_test.go:81:2: the goroutine calls T.Fatal, which must be called in the same goroutine as the test (SA2002)
        integration/radvd/radvd_test.go:83:4: call to T.Fatal
internal/dhcp4/dhcp4.go:103:14: error strings should not be capitalized (ST1005)
internal/dhcp4d/dhcp4d_test.go:115:34: use net.IP.Equal to compare net.IPs, not bytes.Equal (SA1021)
internal/dhcp4d/dhcp4d_test.go:158:52: use net.IP.Equal to compare net.IPs, not bytes.Equal (SA1021)
internal/dhcp4d/dhcp4d_test.go:166:53: use net.IP.Equal to compare net.IPs, not bytes.Equal (SA1021)
internal/dhcp4d/dhcp4d_test.go:191:53: use net.IP.Equal to compare net.IPs, not bytes.Equal (SA1021)
internal/dhcp4d/dhcp4d_test.go:230:53: use net.IP.Equal to compare net.IPs, not bytes.Equal (SA1021)
internal/dhcp4d/dhcp4d_test.go:242:53: use net.IP.Equal to compare net.IPs, not bytes.Equal (SA1021)
internal/dhcp4d/dhcp4d_test.go:249:53: use net.IP.Equal to compare net.IPs, not bytes.Equal (SA1021)
internal/dhcp4d/dhcp4d_test.go:256:53: use net.IP.Equal to compare net.IPs, not bytes.Equal (SA1021)
internal/dhcp4d/dhcp4d_test.go:282:52: use net.IP.Equal to compare net.IPs, not bytes.Equal (SA1021)
internal/dhcp4d/dhcp4d_test.go:315:54: use net.IP.Equal to compare net.IPs, not bytes.Equal (SA1021)
internal/dhcp4d/dhcp4d_test.go:328:54: use net.IP.Equal to compare net.IPs, not bytes.Equal (SA1021)
internal/dhcp4d/dhcp4d_test.go:362:54: use net.IP.Equal to compare net.IPs, not bytes.Equal (SA1021)
internal/dhcp4d/dhcp4d_test.go:411:52: use net.IP.Equal to compare net.IPs, not bytes.Equal (SA1021)
internal/dhcp4d/dhcp4d_test.go:455:52: use net.IP.Equal to compare net.IPs, not bytes.Equal (SA1021)
internal/dhcp6/dhcp6.go:171:15: error strings should not be capitalized (ST1005)
internal/dns/dns.go:330:5: error var sentinelEmpty should have name of the form errFoo (ST1012)
internal/dns/dns_test.go:415:62: use net.IP.Equal to compare net.IPs, not bytes.Equal (SA1021)
internal/netconfig/netconfig.go:240:2: this value of err is never used (SA4006)
internal/radvd/radvd.go:266:14: icmp.DefaultMessageBody is deprecated: Use RawBody instead.  (SA1019)
internal/testing/dnsmasq/dnsmasq.go:112:2: the goroutine calls T.Fatalf, which must be called in the same goroutine as the test (SA2002)
        internal/testing/dnsmasq/dnsmasq.go:119:4: call to T.Fatalf

I will take a look and fix up a few of these at a time too!

stapelberg commented 4 years ago

Hey! Cool! Thank you! :)