diff --git a/Makefile b/Makefile index a34a6e3..02dbd6d 100644 --- a/Makefile +++ b/Makefile @@ -31,7 +31,7 @@ ci-test: ci-lint: $(GOCMD) get -u github.com/alecthomas/gometalinter gometalinter --install golint - gometalinter --deadline=1m --disable-all --enable=gofmt --enable=golint --enable=vet --enable=vetshadow --enable=structcheck --enable=unconvert --vendor ./... + gometalinter --deadline=1m --disable-all --enable=gofmt --enable=golint --enable=vet --enable=structcheck --enable=unconvert --vendor ./... .PHONY: update-ipxe update-ipxe: diff --git a/pixiecore/booters.go b/pixiecore/booters.go index af5be82..a83daa8 100644 --- a/pixiecore/booters.go +++ b/pixiecore/booters.go @@ -102,14 +102,14 @@ func (s *staticBooter) ReadBootFile(id ID) (io.ReadCloser, int64, error) { return s.serveFile(s.kernel) case strings.HasPrefix(path, "initrd-"): - i, err := strconv.Atoi(string(path[7:])) + i, err := strconv.Atoi(path[7:]) if err != nil || i < 0 || i >= len(s.initrd) { return nil, -1, fmt.Errorf("no file with ID %q", id) } return s.serveFile(s.initrd[i]) case strings.HasPrefix(path, "other-"): - i, err := strconv.Atoi(string(path[6:])) + i, err := strconv.Atoi(path[6:]) if err != nil || i < 0 || i >= len(s.otherIDs) { return nil, -1, fmt.Errorf("no file with ID %q", id) } diff --git a/pixiecore/dhcp_server.go b/pixiecore/dhcp_server.go index d853d46..afda1f5 100644 --- a/pixiecore/dhcp_server.go +++ b/pixiecore/dhcp_server.go @@ -18,16 +18,14 @@ import ( "errors" "fmt" "net" - "time" "go.universe.tf/netboot/dhcp4" - "golang.org/x/net/icmp" ) type dhcpServer struct { - dhcpConn *dhcp4.Conn // Used for sending only - icmpConn icmp.PacketConn - leases []lease + //dhcpConn *dhcp4.Conn // Used for sending only + //icmpConn icmp.PacketConn + leases []lease } const ( @@ -37,9 +35,9 @@ const ( ) type lease struct { - state int - mac net.HardwareAddr - expires time.Time + state int + //mac net.HardwareAddr + //expires time.Time } func newDHCPServer(address string, dhcpConn *dhcp4.Conn) (*dhcpServer, error) { diff --git a/pixiecore/urlsign.go b/pixiecore/urlsign.go index aeca89c..0ad30a0 100644 --- a/pixiecore/urlsign.go +++ b/pixiecore/urlsign.go @@ -58,7 +58,7 @@ func getURL(id ID, key *[32]byte) (string, error) { var nonce [24]byte copy(nonce[:], signed) - out, ok := secretbox.Open(nil, []byte(signed[24:]), &nonce, key) + out, ok := secretbox.Open(nil, signed[24:], &nonce, key) if !ok { return "", errors.New("signature verification failed") } diff --git a/tftp/tftp.go b/tftp/tftp.go index 62f4581..0599c21 100644 --- a/tftp/tftp.go +++ b/tftp/tftp.go @@ -222,7 +222,7 @@ func (s *Server) transfer(addr net.Addr, req *rrq) error { conn.Write(tftpError("internal server error")) return fmt.Errorf("writing seqnum: %s", err) } - n, err := io.CopyN(&b, file, int64(req.BlockSize)) + n, err := io.CopyN(&b, file, req.BlockSize) if err != nil && err != io.EOF { conn.Write(tftpError("internal server error")) return fmt.Errorf("reading bytes for block %d: %s", seq, err)