Gofmt formats Go programs. We run gofmt -s
on your code, where -s
is for the "simplify" command
No problems detected. Good job!
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!
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.
Golint is a linter for Go source code.
-
device-modbus-go/internal/driver/modbusclient.go
- Line 32: warning: exported method ModbusClient.OpenConnection should have comment or be unexported (golint)
- Line 48: warning: exported method ModbusClient.CloseConnection should have comment or be unexported (golint)
- Line 59: warning: exported method ModbusClient.GetValue should have comment or be unexported (golint)
- Line 89: warning: exported method ModbusClient.SetValue should have comment or be unexported (golint)
- Line 123: warning: exported function NewDeviceClient should have comment or be unexported (golint)
-
device-modbus-go/internal/driver/constant.go
- Line 14: warning: exported const BOOL should have comment (or a comment on this block) or be unexported (golint)
- Line 42: warning: exported var PrimaryTableBitCountMap should have comment or be unexported (golint)
- Line 49: warning: exported var ValueTypeBitCountMap should have comment or be unexported (golint)
-
device-modbus-go/internal/driver/driver.go
- Line 23: warning: exported type Driver should have comment or be unexported (golint)
- Line 34: warning: exported method Driver.DisconnectDevice should have comment or be unexported (golint)
- Line 90: warning: exported method Driver.HandleReadCommands should have comment or be unexported (golint)
- Line 154: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
- Line 161: warning: exported method Driver.HandleWriteCommands should have comment or be unexported (golint)
- Line 223: warning: exported method Driver.Initialize should have comment or be unexported (golint)
- Line 231: warning: exported method Driver.Stop should have comment or be unexported (golint)
- Line 257: warning: exported method Driver.AddDevice should have comment or be unexported (golint)
- Line 262: warning: exported method Driver.UpdateDevice should have comment or be unexported (golint)
- Line 267: warning: exported method Driver.RemoveDevice should have comment or be unexported (golint)
- Line 272: warning: exported function NewProtocolDriver should have comment or be unexported (golint)
Checks whether your project has a LICENSE file.
No problems detected. Good job!
IneffAssign detects ineffectual assignments in Go code.
No problems detected. Good job!
Misspell Finds commonly misspelled English words
No problems detected. Good job!