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!
Golint is a linter for Go source code.
-
grabc_example/controllers/user.go
- Line 3: warning: exported type UserController should have comment or be unexported (golint)
- Line 7: warning: comment on exported method UserController.Modifypassword should be of the form "Modifypassword ..." (golint)
- Line 8: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
-
grabc_example/models/user.go
- Line 7: warning: a blank import should be only in a main or test package, or have a comment justifying it (golint)
- Line 8: warning: should not use dot imports (golint)
- Line 12: warning: don't use underscores in Go names; var db_host should be dbHost (golint)
- Line 13: warning: don't use underscores in Go names; var db_user should be dbUser (golint)
- Line 14: warning: don't use underscores in Go names; var db_password should be dbPassword (golint)
- Line 15: warning: don't use underscores in Go names; var db_port should be dbPort (golint)
- Line 16: warning: don't use underscores in Go names; var db_name should be dbName (golint)
- Line 22: warning: exported type User should have comment or be unexported (golint)
- Line 29: warning: comment on exported method User.TableName should be of the form "TableName ..." (golint)
- Line 30: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
- Line 34: warning: comment on exported method User.FindByPhone should be of the form "FindByPhone ..." (golint)
- Line 35: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
- Line 44: warning: comment on exported method User.ValidatePassword should be of the form "ValidatePassword ..." (golint)
- Line 45: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
- Line 49: warning: comment on exported method User.UserList should be of the form "UserList ..." (golint)
- Line 50: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
- Line 59: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
- Line 69: warning: comment on exported method User.FindById should be of the form "FindById ..." (golint)
- Line 70: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
- Line 75: warning: comment on exported method User.FindNameById should be of the form "FindNameById ..." (golint)
- Line 76: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
-
grabc_example/controllers/base.go
- Line 8: warning: should not use dot imports (golint)
- Line 13: warning: comment on exported type BaseController should be of the form "BaseController ..." (with optional leading article) (golint)
- Line 23: warning: comment on exported method BaseController.Prepare should be of the form "Prepare ..." (golint)
- Line 24: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
- Line 31: warning: comment on exported method BaseController.Redirect should be of the form "Redirect ..." (golint)
- Line 32: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
- Line 37: warning: comment on exported method BaseController.ShowHtml should be of the form "ShowHtml ..." (golint)
- Line 38: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
- Line 60: warning: comment on exported method BaseController.Login should be of the form "Login ..." (golint)
- Line 61: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
- Line 79: warning: comment on exported method BaseController.Logout should be of the form "Logout ..." (golint)
- Line 80: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
- Line 84: warning: comment on exported method BaseController.IsLogin should be of the form "IsLogin ..." (golint)
- Line 85: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
- Line 89: warning: comment on exported method BaseController.CheckPermision should be of the form "CheckPermision ..." (golint)
- Line 90: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
- Line 109: warning: comment on exported method BaseController.IsPost should be of the form "IsPost ..." (golint)
- Line 110: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
-
grabc_example/controllers/site.go
- Line 8: warning: exported type SiteController should have comment or be unexported (golint)
- Line 13: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
- Line 34: warning: comment on exported method SiteController.Index should be of the form "Index ..." (golint)
- Line 35: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
- Line 40: warning: exported method SiteController.Logout should have comment or be unexported (golint)
- Line 40: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
- Line 48: warning: comment on exported method SiteController.NoPermission should be of the form "NoPermission ..." (golint)
- Line 49: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
- Line 54: warning: exported method SiteController.RABCMethods should have comment or be unexported (golint)
- Line 54: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
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!
Checks whether your project has a LICENSE file.
IneffAssign detects ineffectual assignments in Go code.
No problems detected. Good job!
Misspell Finds commonly misspelled English words
No problems detected. Good job!