Code Cleanup
Closed this issue · 0 comments
damianoneill commented
Issues identified by gometalinter, will work through these and push up a pull request.
$ gometalinter ./...
examples/juniper/get_system_information.go:33:6:warning: exported type SystemInformation should have comment or be unexported (golint)
examples/juniper/get_system_information.go:41:1:warning: exported function BuildConfig should have comment or be unexported (golint)
netconf/session.go:7:1:warning: package comment should be of the form "Package netconf ..." (golint)
netconf/transport_ssh.go:180:3:warning: ineffectual assignment to b (ineffassign)
netconf/rpc.go:133::warning: Errors unhandled.,LOW,HIGH (gas)
netconf/transport.go:52::warning: Errors unhandled.,LOW,HIGH (gas)
netconf/transport.go:55::warning: Errors unhandled.,LOW,HIGH (gas)
netconf/transport.go:57::warning: Errors unhandled.,LOW,HIGH (gas)
netconf/transport.go:58::warning: Errors unhandled.,LOW,HIGH (gas)
netconf/transport.go:91::warning: Errors unhandled.,LOW,HIGH (gas)
netconf/transport.go:92::warning: Errors unhandled.,LOW,HIGH (gas)
netconf/transport_junos.go:30::warning: Subprocess launching with partial path.,MEDIUM,HIGH (gas)
examples/juniper/get_system_information.go:104:15:warning: error return value not checked (defer s.Close()) (errcheck)
examples/juniper/get_system_information.go:112:15:warning: error return value not checked (xml.Unmarshal([]byte(reply.RawReply), &q)) (errcheck)
examples/ssh1/ssh1.go:30:15:warning: error return value not checked (defer s.Close()) (errcheck)
examples/ssh2/ssh2.go:30:15:warning: error return value not checked (defer s.Close()) (errcheck)
netconf/rpc.go:133:13:warning: error return value not checked (io.ReadFull(rand.Reader, b)) (errcheck)
netconf/session.go:71:13:warning: error return value not checked (t.SendHello(&HelloMessage{Capabilities: DefaultCapabilities})) (errcheck)
netconf/transport.go:52:9:warning: error return value not checked (t.Write(data)) (errcheck)
netconf/transport.go:55:10:warning: error return value not checked (t.Write([]byte(" "))) (errcheck)
netconf/transport.go:57:9:warning: error return value not checked (t.Write([]byte(msgSeperator))) (errcheck)
netconf/transport.go:58:9:warning: error return value not checked (t.Write([]byte("\n"))) (errcheck)
netconf/transport.go:91:9:warning: error return value not checked (t.Write(b)) (errcheck)
netconf/transport.go:92:9:warning: error return value not checked (t.Write([]byte("\n"))) (errcheck)
netconf/transport_junos.go:21:26:warning: error return value not checked (t.ReadWriteCloser.Close()) (errcheck)
netconf/transport_ssh.go:243:19:warning: error return value not checked (c.SetReadDeadline(time.Now().Add(c.timeout))) (errcheck)
netconf/transport_ssh.go:248:20:warning: error return value not checked (c.SetWriteDeadline(time.Now().Add(c.timeout))) (errcheck)
netconf/transport.go:46:2:warning: unused struct field github.com/Juniper/go-netconf/netconf.transportBasicIO.chunkedFraming (structcheck)
examples/juniper/get_system_information.go:61:47:warning: unnecessary conversion (unconvert)
examples/juniper/get_system_information.go:77:49:warning: unnecessary conversion (unconvert)
netconf/transport.go:86:28:warning: unnecessary conversion (unconvert)
netconf/transport_ssh.go:180:3:warning: this value of b is never used (SA4006) (megacheck)
examples/juniper/get_system_information.go:44:5:warning: should omit comparison to bool constant, can be simplified to *pubkey (S1002) (megacheck)
netconf/rpc_test.go:149:6:warning: should omit comparison to bool constant, can be simplified to !valid(int(v)) (S1002) (megacheck)
netconf/transport_ssh.go:74:2:warning: 'if err != nil { return err }; return nil' can be simplified to 'return err' (S1013) (megacheck)
netconf/transport.go:46:2:warning: field chunkedFraming is unused (U1000) (megacheck)