Preparing report...

Report for github.com/peter-wangxu/goock

A+    Excellent!    Found 17 issues across 30 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!


gocyclo100%

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.

No problems detected. Good job!


golint53%

Golint is a linter for Go source code.

    • goock/util/common.go
    • Line 1: warning: package comment should be of the form "Package util ..." (golint)
    • Line 26: warning: exported const WaitInterval should have comment (or a comment on this block) or be unexported (golint)
    • Line 32: warning: exported function SetLogger should have comment or be unexported (golint)
    • Line 38: warning: exported function SetExecutor should have comment or be unexported (golint)
    • Line 42: warning: exported function WaitForPath should have comment or be unexported (golint)
    • Line 54: warning: comment on exported function WaitForAnyPath should be of the form "WaitForAnyPath ..." (golint)
    • Line 108: warning: exported function IsPathExists should have comment or be unexported (golint)
    • Line 113: warning: exported function Contains should have comment or be unexported (golint)
    • goock/exec/exec.go
    • Line 30: warning: exported function SetLogger should have comment or be unexported (golint)
    • Line 36: warning: exported var ErrExecutableNotFound should have comment or be unexported (golint)
    • Line 37: warning: exported var ErrExitError should have comment or be unexported (golint)
    • Line 76: warning: exported var FileNotFound should have comment or be unexported (golint)
    • Line 77: warning: exported var Unknown should have comment or be unexported (golint)
    • Line 162: warning: error should be the last type when returning multiple items (golint)
    • Line 220: warning: exported method CodeExitError.Exited should have comment or be unexported (golint)
    • Line 224: warning: exported method CodeExitError.ExitStatus should have comment or be unexported (golint)
    • goock/test/helper/helper.go
    • Line 1: warning: package comment should be of the form "Package helper ..." (golint)
    • Line 23: warning: exported function SkipIfWindows should have comment or be unexported (golint)
    • goock/connector/fibre_channel.go
    • Line 14: warning: comment on exported const FibreChannelPathPattern should be of the form "FibreChannelPathPattern ..." (golint)
    • Line 18: warning: comment on exported type FibreChannelConnector should be of the form "FibreChannelConnector ..." (with optional leading article) (golint)
    • Line 23: warning: comment on exported function NewFibreChannelConnector should be of the form "NewFibreChannelConnector ..." (golint)
    • Line 28: warning: comment on exported method FibreChannelConnector.GetHostInfo should be of the form "GetHostInfo ..." (golint)
    • Line 33: warning: comment on exported method FibreChannelConnector.ConnectVolume should be of the form "ConnectVolume ..." (golint)
    • Line 69: warning: comment on exported method FibreChannelConnector.ExtendVolume should be of the form "ExtendVolume ..." (golint)
    • goock/linux/multipath.go
    • Line 1: warning: package comment should be of the form "Package linux ..." (golint)
    • Line 25: warning: exported function IsMultipathEnabled should have comment or be unexported (golint)
    • Line 33: warning: comment on exported function FlushPath should be of the form "FlushPath ..." (golint)
    • Line 53: warning: comment on exported function Reload should be of the form "Reload ..." (golint)
    • Line 62: warning: comment on exported function CheckDevice should be of the form "CheckDevice ..." (golint)
    • Line 72: warning: exported function ResizeMpath should have comment or be unexported (golint)
    • Line 80: warning: comment on exported function FindMpathByWwn should be of the form "FindMpathByWwn ..." (golint)
    • Line 109: warning: comment on exported function FindMpathByPath should be of the form "FindMpathByPath ..." (golint)
    • Line 124: warning: exported function FindMultipathByWwn should have comment or be unexported (golint)
    • goock/test/mock_util.go
    • Line 1: warning: package comment should be of the form "Package test ..." (golint)
    • Line 34: warning: exported type MockExecutor should have comment or be unexported (golint)
    • Line 38: warning: exported method MockExecutor.Command should have comment or be unexported (golint)
    • Line 42: warning: exported method MockExecutor.LookPath should have comment or be unexported (golint)
    • Line 46: warning: exported function NewMockExecutor should have comment or be unexported (golint)
    • Line 50: warning: exported type MockCmd should have comment or be unexported (golint)
    • Line 59: warning: exported method MockCmd.SetDir should have comment or be unexported (golint)
    • Line 63: warning: exported method MockCmd.SetStdin should have comment or be unexported (golint)
    • Line 71: warning: exported method MockCmd.SetStdout should have comment or be unexported (golint)
    • Line 75: warning: exported method MockCmd.CombinedOutput should have comment or be unexported (golint)
    • Line 79: warning: exported method MockCmd.Output should have comment or be unexported (golint)
    • Line 133: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • goock/connector/base.go
    • Line 30: warning: exported type StringEnum should have comment or be unexported (golint)
    • Line 33: warning: exported const ReadWrite should have comment (or a comment on this block) or be unexported (golint)
    • Line 38: warning: exported const IscsiProtocol should have comment (or a comment on this block) or be unexported (golint)
    • Line 42: warning: exported type ConnectionProperty should have comment or be unexported (golint)
    • Line 57: warning: exported function SetExecutor should have comment or be unexported (golint)
    • Line 78: warning: exported type HostInfo should have comment or be unexported (golint)
    • Line 96: warning: exported type VolumeInfo should have comment or be unexported (golint)
    • Line 106: warning: exported type Interface should have comment or be unexported (golint)
    • Line 113: warning: exported type ISCSIInterface should have comment or be unexported (golint)
    • Line 123: warning: exported type FibreChannelInterface should have comment or be unexported (golint)
    • Line 132: warning: exported function SetLogger should have comment or be unexported (golint)
    • Line 138: warning: comment on exported function FormatLuns should be of the form "FormatLuns ..." (golint)
    • goock/connector/iscsi.go
    • Line 1: warning: package comment should be of the form "Package connector ..." (golint)
    • Line 29: warning: exported const ISCSIPathPattern should have comment (or a comment on this block) or be unexported (golint)
    • Line 32: warning: exported type OPERATION_ENUM should have comment or be unexported (golint)
    • Line 35: warning: exported const OperationNew should have comment (or a comment on this block) or be unexported (golint)
    • Line 42: warning: exported type ISCSIConnector should have comment or be unexported (golint)
    • Line 46: warning: exported function NewISCSIConnector should have comment or be unexported (golint)
    • Line 50: warning: comment on exported method ISCSIConnector.GetHostInfo should be of the form "GetHostInfo ..." (golint)
    • Line 67: warning: don't use underscores in Go names; var target_iqns should be targetIqns (golint)
    • Line 68: warning: don't use underscores in Go names; var target_portals should be targetPortals (golint)
    • Line 69: warning: don't use underscores in Go names; var target_luns should be targetLuns (golint)
    • Line 70: warning: don't use underscores in Go names; var potential_paths should be potentialPaths (golint)
    • Line 84: warning: comment on exported method ISCSIConnector.DiscoverPortal should be of the form "DiscoverPortal ..." (golint)
    • Line 92: warning: comment on exported method ISCSIConnector.LoginPortal should be of the form "LoginPortal ..." (golint)
    • Line 115: warning: comment on exported method ISCSIConnector.SetNode2Auto should be of the form "SetNode2Auto ..." (golint)
    • Line 153: warning: comment on exported method ISCSIConnector.ExtendVolume should be of the form "ExtendVolume ..." (golint)
    • Line 173: warning: comment on exported method ISCSIConnector.ConnectVolume should be of the form "ConnectVolume ..." (golint)
    • Line 233: warning: exported method ISCSIConnector.DisconnectVolume should have comment or be unexported (golint)
    • Line 270: warning: should replace errors.New(fmt.Sprintf(...)) with fmt.Errorf(...) (golint)
    • goock/linux/base.go
    • Line 10: warning: exported function SetLogger should have comment or be unexported (golint)
    • Line 16: warning: exported function SetExecutor should have comment or be unexported (golint)
    • goock/linux/fc.go
    • Line 1: warning: package comment should be of the form "Package linux ..." (golint)
    • Line 25: warning: exported function IsFCSupport should have comment or be unexported (golint)
    • Line 33: warning: exported function GetFCHBA should have comment or be unexported (golint)
    • Line 37: warning: exported function GetFcWwpn should have comment or be unexported (golint)
    • Line 50: warning: exported function GetFcWwnn should have comment or be unexported (golint)
    • Line 63: warning: comment on exported function RescanHosts should be of the form "RescanHosts ..." (golint)
    • Line 71: warning: exported function IsFCDevice should have comment or be unexported (golint)
    • goock/linux/scsi.go
    • Line 1: warning: package comment should be of the form "Package linux ..." (golint)
    • Line 28: warning: exported function GetWWN should have comment or be unexported (golint)
    • Line 37: warning: comment on exported function CheckReadWrite should be of the form "CheckReadWrite ..." (golint)
    • Line 68: warning: comment on exported function GetDeviceSize should be of the form "GetDeviceSize ..." (golint)
    • Line 82: warning: comment on exported function ScanSCSIBus should be of the form "ScanSCSIBus ..." (golint)
    • Line 94: warning: comment on exported function RemoveSCSIDevice should be of the form "RemoveSCSIDevice ..." (golint)
    • Line 111: warning: comment on exported function FlushDeviceIO should be of the form "FlushDeviceIO ..." (golint)
    • Line 119: warning: comment on exported function ExtendDevice should be of the form "ExtendDevice ..." (golint)
    • Line 145: warning: comment on exported function GetDeviceInfo should be of the form "GetDeviceInfo ..." (golint)
    • goock/model/model.go
    • Line 1: warning: package comment should be of the form "Package model ..." (golint)
    • Line 30: warning: exported function SetLogger should have comment or be unexported (golint)
    • Line 36: warning: exported function SetExecutor should have comment or be unexported (golint)
    • Line 40: warning: exported type Parser should have comment or be unexported (golint)
    • Line 46: warning: comment on exported type LineParser should be of the form "LineParser ..." (with optional leading article) (golint)
    • Line 53: warning: exported method LineParser.Parse should have comment or be unexported (golint)
    • Line 54: warning: don't use underscores in Go names; var pat_str should be patStr (golint)
    • Line 84: warning: exported method LineParser.Split should have comment or be unexported (golint)
    • Line 94: warning: exported type PairParser should have comment or be unexported (golint)
    • Line 99: warning: exported method PairParser.Parse should have comment or be unexported (golint)
    • Line 106: warning: don't use underscores in Go names; var pat_list should be patList (golint)
    • Line 108: warning: don't use underscores in Go names; range var m_pat should be mPat (golint)
    • Line 114: warning: don't use underscores in Go names; var match_names should be matchNames (golint)
    • Line 133: warning: exported method PairParser.Split should have comment or be unexported (golint)
    • Line 154: warning: comment on exported type ISCSISession should be of the form "ISCSISession ..." (with optional leading article) (golint)
    • Line 165: warning: exported method ISCSISession.GetPattern should have comment or be unexported (golint)
    • Line 169: warning: exported method ISCSISession.GetCommand should have comment or be unexported (golint)
    • Line 173: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 178: warning: exported method ISCSISession.GetValue should have comment or be unexported (golint)
    • Line 188: warning: exported method ISCSISession.Parse should have comment or be unexported (golint)
    • Line 210: warning: exported function NewISCSISession should have comment or be unexported (golint)
    • Line 214: warning: comment on exported function DiscoverISCSISession should be of the form "DiscoverISCSISession ..." (golint)
    • Line 254: warning: comment on exported type HBA should be of the form "HBA ..." (with optional leading article) (golint)
    • Line 269: warning: exported method HBA.GetPattern should have comment or be unexported (golint)
    • Line 283: warning: exported method HBA.GetCommand should have comment or be unexported (golint)
    • Line 287: warning: exported method HBA.GetValue should have comment or be unexported (golint)
    • Line 296: warning: exported method HBA.Parse should have comment or be unexported (golint)
    • Line 319: warning: comment on exported method HBA.GetHostId should be of the form "GetHostId ..." (golint)
    • Line 328: warning: exported function NewHBA should have comment or be unexported (golint)
    • Line 332: warning: comment on exported type FibreChannelTarget should be of the form "FibreChannelTarget ..." (with optional leading article) (golint)
    • Line 346: warning: exported method FibreChannelTarget.GetPattern should have comment or be unexported (golint)
    • Line 359: warning: exported method FibreChannelTarget.GetCommand should have comment or be unexported (golint)
    • Line 363: warning: exported method FibreChannelTarget.GetValue should have comment or be unexported (golint)
    • Line 372: warning: exported method FibreChannelTarget.Parse should have comment or be unexported (golint)
    • Line 395: warning: comment on exported method FibreChannelTarget.GetHostChannelTarget should be of the form "GetHostChannelTarget ..." (golint)
    • Line 410: warning: exported function NewFibreChannelTarget should have comment or be unexported (golint)
    • Line 414: warning: comment on exported type Multipath should be of the form "Multipath ..." (with optional leading article) (golint)
    • Line 433: warning: exported method Multipath.GetPattern should have comment or be unexported (golint)
    • Line 438: warning: exported method Multipath.GetCommand should have comment or be unexported (golint)
    • Line 441: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 446: warning: exported method Multipath.GetValue should have comment or be unexported (golint)
    • Line 455: warning: exported method Multipath.Parse should have comment or be unexported (golint)
    • Line 482: warning: exported method Multipath.SetParams should have comment or be unexported (golint)
    • Line 486: warning: exported function NewMultipath should have comment or be unexported (golint)
    • Line 490: warning: exported function FindMultipath should have comment or be unexported (golint)
    • Line 496: warning: comment on exported type SinglePath should be of the form "SinglePath ..." (with optional leading article) (golint)
    • Line 518: warning: exported method SinglePath.GetPattern should have comment or be unexported (golint)
    • Line 523: warning: exported method SinglePath.GetCommand should have comment or be unexported (golint)
    • Line 531: warning: exported method SinglePath.SetOutput should have comment or be unexported (golint)
    • Line 535: warning: exported method SinglePath.GetValue should have comment or be unexported (golint)
    • Line 548: warning: exported method SinglePath.Parse should have comment or be unexported (golint)
    • Line 562: warning: exported function NewSinglePath should have comment or be unexported (golint)
    • Line 570: warning: exported type DeviceInfo should have comment or be unexported (golint)
    • Line 581: warning: exported method DeviceInfo.GetPattern should have comment or be unexported (golint)
    • Line 585: warning: exported method DeviceInfo.GetCommand should have comment or be unexported (golint)
    • Line 588: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 602: warning: exported method DeviceInfo.GetValue should have comment or be unexported (golint)
    • Line 615: warning: exported method DeviceInfo.Parse should have comment or be unexported (golint)
    • Line 629: warning: exported method DeviceInfo.GetHostId should have comment or be unexported (golint)
    • Line 634: warning: comment on exported method DeviceInfo.GetDeviceIdentifier should be of the form "GetDeviceIdentifier ..." (golint)
    • Line 639: warning: exported function NewDeviceInfo should have comment or be unexported (golint)
    • Line 690: warning: exported function SetValue should have comment or be unexported (golint)

license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


ineffassign90%

IneffAssign detects ineffectual assignments in Go code.


misspell100%

Misspell Finds commonly misspelled English words

No problems detected. Good job!