Preparing report...

Report for github.com/ICKelin/gtun

A+    Excellent!    Found 21 issues across 53 files

Tweet

gofmt100%

Gofmt formats Go programs. We run gofmt -s on your code, where -s is for the "simplify" command

No problems detected. Good job!


go_vet100%

go vet examines Go source code and reports suspicious constructs, such as Printf calls whose arguments do not align with the format string.

No problems detected. Good job!


golint62%

Golint is a linter for Go source code.

    • gtun/gtund/server.go
    • Line 22: warning: exported type ServerConfig should have comment or be unexported (golint)
    • Line 27: warning: exported type Server should have comment or be unexported (golint)
    • Line 32: warning: exported function NewServer should have comment or be unexported (golint)
    • Line 41: warning: exported method Server.Run should have comment or be unexported (golint)
    • gtun/transport/kcp/server/server.go
    • Line 12: warning: a blank import should be only in a main or test package, or have a comment justifying it (golint)
    • Line 118: warning: exported function KCPServer should have comment or be unexported (golint)
    • Line 254: warning: exported function Main should have comment or be unexported (golint)
    • gtun/gtun/main.go
    • Line 7: warning: a blank import should be only in a main or test package, or have a comment justifying it (golint)
    • Line 16: warning: exported function Main should have comment or be unexported (golint)
    • gtun/internal/proto/cs.go
    • Line 9: warning: exported const CmdAuth should have comment (or a comment on this block) or be unexported (golint)
    • Line 14: warning: exported type C2SAuth should have comment or be unexported (golint)
    • Line 18: warning: exported type S2CAuth should have comment or be unexported (golint)
    • Line 23: warning: exported type ProxyProtocol should have comment or be unexported (golint)
    • Line 31: warning: exported function EncodeData should have comment or be unexported (golint)
    • Line 38: warning: exported function EncodeProxyProtocol should have comment or be unexported (golint)
    • gtun/transport/mux/mux.go
    • Line 14: warning: exported type Dialer should have comment or be unexported (golint)
    • Line 16: warning: exported type Listener should have comment or be unexported (golint)
    • Line 20: warning: exported type Conn should have comment or be unexported (golint)
    • Line 24: warning: exported method Conn.OpenStream should have comment or be unexported (golint)
    • Line 33: warning: exported method Conn.AcceptStream should have comment or be unexported (golint)
    • Line 37: warning: exported method Conn.Close should have comment or be unexported (golint)
    • Line 41: warning: exported method Conn.IsClosed should have comment or be unexported (golint)
    • Line 45: warning: exported method Dialer.Dial should have comment or be unexported (golint)
    • Line 59: warning: exported method Listener.Accept should have comment or be unexported (golint)
    • Line 73: warning: exported method Listener.Close should have comment or be unexported (golint)
    • Line 77: warning: exported function Listen should have comment or be unexported (golint)
    • gtun/gtun/udpforward.go
    • Line 32: warning: exported type UDPForward should have comment or be unexported (golint)
    • Line 50: warning: exported function NewUDPForward should have comment or be unexported (golint)
    • Line 129: warning: exported method UDPForward.Serve should have comment or be unexported (golint)
    • gtun/transport/types.go
    • Line 8: warning: exported type Dialer should have comment or be unexported (golint)
    • Line 12: warning: exported type Listener should have comment or be unexported (golint)
    • Line 18: warning: exported type Conn should have comment or be unexported (golint)
    • Line 25: warning: exported type Stream should have comment or be unexported (golint)
    • gtun/transport/kcp/kcp.go
    • Line 14: warning: exported type Dialer should have comment or be unexported (golint)
    • Line 16: warning: exported type Conn should have comment or be unexported (golint)
    • Line 20: warning: exported type Listener should have comment or be unexported (golint)
    • Line 24: warning: exported method Conn.OpenStream should have comment or be unexported (golint)
    • Line 33: warning: exported method Conn.AcceptStream should have comment or be unexported (golint)
    • Line 37: warning: exported method Conn.Close should have comment or be unexported (golint)
    • Line 41: warning: exported method Conn.IsClosed should have comment or be unexported (golint)
    • Line 45: warning: exported method Dialer.Dial should have comment or be unexported (golint)
    • Line 67: warning: exported method Listener.Accept should have comment or be unexported (golint)
    • Line 87: warning: exported method Listener.Close should have comment or be unexported (golint)
    • Line 91: warning: exported method Listener.Addr should have comment or be unexported (golint)
    • Line 95: warning: exported function Listen should have comment or be unexported (golint)
    • gtun/gtund/config.go
    • Line 10: warning: exported type Config should have comment or be unexported (golint)
    • Line 15: warning: exported type Log should have comment or be unexported (golint)
    • Line 21: warning: exported function ParseConfig should have comment or be unexported (golint)
    • gtun/gtun/session.go
    • Line 37: warning: exported method SessionManager.AddSession should have comment or be unexported (golint)
    • Line 41: warning: exported method SessionManager.GetSession should have comment or be unexported (golint)
    • Line 49: warning: exported method SessionManager.DeleteSession should have comment or be unexported (golint)
    • gtun/gtun/tcpforward.go
    • Line 19: warning: exported type TCPForward should have comment or be unexported (golint)
    • Line 38: warning: exported function NewTCPForward should have comment or be unexported (golint)
    • Line 63: warning: exported method TCPForward.Listen should have comment or be unexported (golint)
    • Line 83: warning: exported method TCPForward.Serve should have comment or be unexported (golint)
    • gtun/transport/kcp/client/client.go
    • Line 93: warning: exported function KCPClient should have comment or be unexported (golint)
    • Line 213: warning: if block ends with a return statement, so drop this else and outdent its block (move short variable declaration to its own line if necessary) (golint)
    • Line 322: warning: exported function Main should have comment or be unexported (golint)
    • gtun/transport/quick/quic.go
    • Line 20: warning: exported type Dialer should have comment or be unexported (golint)
    • Line 22: warning: exported type Listener should have comment or be unexported (golint)
    • Line 26: warning: exported type Conn should have comment or be unexported (golint)
    • Line 30: warning: exported method Conn.OpenStream should have comment or be unexported (golint)
    • Line 38: warning: exported method Conn.AcceptStream should have comment or be unexported (golint)
    • Line 42: warning: exported method Conn.Close should have comment or be unexported (golint)
    • Line 46: warning: exported method Conn.IsClosed should have comment or be unexported (golint)
    • Line 50: warning: exported method Dialer.Dial should have comment or be unexported (golint)
    • Line 65: warning: exported method Listener.Accept should have comment or be unexported (golint)
    • Line 73: warning: exported method Listener.Close should have comment or be unexported (golint)
    • Line 77: warning: exported function Listen should have comment or be unexported (golint)
    • gtun/gtun/client.go
    • Line 10: warning: exported type ClientConfig should have comment or be unexported (golint)
    • Line 16: warning: exported type Client should have comment or be unexported (golint)
    • Line 21: warning: exported function NewClient should have comment or be unexported (golint)
    • Line 28: warning: exported method Client.Run should have comment or be unexported (golint)
    • gtun/gtun/config.go
    • Line 9: warning: exported type Config should have comment or be unexported (golint)
    • Line 14: warning: exported type ForwardConfig should have comment or be unexported (golint)
    • Line 21: warning: exported type TCPForwardConfig should have comment or be unexported (golint)
    • Line 27: warning: exported type UDPForwardConfig should have comment or be unexported (golint)
    • Line 34: warning: exported type Log should have comment or be unexported (golint)
    • Line 40: warning: exported function ParseConfig should have comment or be unexported (golint)

gocyclo94%

Gocyclo calculates cyclomatic complexities of functions in Go source code. The cyclomatic complexity of a function is calculated according to the following rules: 1 is the base complexity of a function +1 for each 'if', 'for', 'case', '&&' or '||' Go Report Card warns on functions with cyclomatic complexity > 15.


ineffassign100%

IneffAssign detects ineffectual assignments in Go code.

No problems detected. Good job!


license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


misspell100%

Misspell Finds commonly misspelled English words

No problems detected. Good job!