Preparing report...

Report for github.com/donutloop/xservice

A+    Excellent!    Found 28 issues across 38 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!


golint28%

Golint is a linter for Go source code.

    • xservice/internal/xgenerator/types/init_struct.go
    • Line 16: warning: exported type InitStructFieldTmplValues should have comment or be unexported (golint)
    • Line 21: warning: exported type InitStructField should have comment or be unexported (golint)
    • Line 26: warning: exported type InitStructGenerator should have comment or be unexported (golint)
    • Line 39: warning: exported function NewInitGoStruct should have comment or be unexported (golint)
    • Line 47: warning: exported method InitStructGenerator.AddUnexportedValueToField should have comment or be unexported (golint)
    • Line 51: warning: exported method InitStructGenerator.AddExportedValueToField should have comment or be unexported (golint)
    • Line 79: warning: exported method InitStructGenerator.Render should have comment or be unexported (golint)
    • xservice/internal/xgenerator/types/switch.go
    • Line 33: warning: exported type SwitchGeneratorMetaData should have comment or be unexported (golint)
    • Line 40: warning: exported type SwitchGenerator should have comment or be unexported (golint)
    • Line 45: warning: exported type Case should have comment or be unexported (golint)
    • Line 50: warning: exported type DefaultCase should have comment or be unexported (golint)
    • Line 54: warning: exported function NewSwitchGenerator should have comment or be unexported (golint)
    • Line 68: warning: exported method SwitchGenerator.UseAssertion should have comment or be unexported (golint)
    • Line 75: warning: exported method SwitchGenerator.Case should have comment or be unexported (golint)
    • Line 79: warning: exported method SwitchGenerator.Default should have comment or be unexported (golint)
    • Line 83: warning: exported method SwitchGenerator.Render should have comment or be unexported (golint)
    • Line 91: warning: exported type CaseGeneratorMetaData should have comment or be unexported (golint)
    • Line 96: warning: exported type CaseGenerator should have comment or be unexported (golint)
    • Line 102: warning: exported const CaseTpl should have comment or be unexported (golint)
    • Line 109: warning: exported function NewCaseGenerator should have comment or be unexported (golint)
    • Line 123: warning: exported method CaseGenerator.Render should have comment or be unexported (golint)
    • Line 132: warning: exported const DefaultCaseTpl should have comment or be unexported (golint)
    • Line 139: warning: exported type DefaultCaseGeneratorMetaData should have comment or be unexported (golint)
    • Line 143: warning: exported type DefaultCaseGenerator should have comment or be unexported (golint)
    • Line 149: warning: exported function NewDefaultCaseGenerator should have comment or be unexported (golint)
    • Line 156: warning: exported method DefaultCaseGenerator.Render should have comment or be unexported (golint)
    • xservice/internal/xgenerator/types/const.go
    • Line 22: warning: exported type ConstMetadata should have comment or be unexported (golint)
    • Line 29: warning: exported type ConstGenerator should have comment or be unexported (golint)
    • Line 34: warning: exported function NewGoConst should have comment or be unexported (golint)
    • Line 82: warning: exported method ConstGenerator.Render should have comment or be unexported (golint)
    • xservice/internal/xgenerator/types/func.go
    • Line 16: warning: exported type FuncGeneratorMetaData should have comment or be unexported (golint)
    • Line 27: warning: exported type FuncGenerator should have comment or be unexported (golint)
    • Line 42: warning: exported function NewGoFunc should have comment or be unexported (golint)
    • Line 73: warning: exported method FuncGenerator.Render should have comment or be unexported (golint)
    • xservice/internal/xgenerator/types/goblock.go
    • Line 21: warning: exported type GoBlockMetaData should have comment or be unexported (golint)
    • Line 25: warning: exported type GoBlockGenerator should have comment or be unexported (golint)
    • Line 46: warning: exported method GoBlockGenerator.Caller should have comment or be unexported (golint)
    • Line 55: warning: exported method GoBlockGenerator.DefCall should have comment or be unexported (golint)
    • Line 81: warning: exported method GoBlockGenerator.DefAssginCall should have comment or be unexported (golint)
    • Line 107: warning: exported method GoBlockGenerator.DefAppend should have comment or be unexported (golint)
    • Line 121: warning: exported method GoBlockGenerator.DefMake should have comment or be unexported (golint)
    • Line 135: warning: exported method GoBlockGenerator.SCallWithDefVar should have comment or be unexported (golint)
    • Line 156: warning: exported method GoBlockGenerator.SCall should have comment or be unexported (golint)
    • Line 173: warning: exported method GoBlockGenerator.DefNew should have comment or be unexported (golint)
    • Line 195: warning: exported method GoBlockGenerator.DefLongVar should have comment or be unexported (golint)
    • Line 199: warning: exported method GoBlockGenerator.DefShortVar should have comment or be unexported (golint)
    • Line 228: warning: exported method GoBlockGenerator.DefStruct should have comment or be unexported (golint)
    • Line 250: warning: exported method GoBlockGenerator.DefOperation should have comment or be unexported (golint)
    • Line 272: warning: exported method GoBlockGenerator.DefAssert should have comment or be unexported (golint)
    • Line 298: warning: exported method GoBlockGenerator.Command should have comment or be unexported (golint)
    • Line 302: warning: exported method GoBlockGenerator.Return should have comment or be unexported (golint)
    • Line 314: warning: exported method GoBlockGenerator.StructAssignment should have comment or be unexported (golint)
    • Line 332: warning: exported method GoBlockGenerator.DefIfWithOwnScopeBegin should have comment or be unexported (golint)
    • Line 341: warning: exported method GoBlockGenerator.DefIfBegin should have comment or be unexported (golint)
    • Line 350: warning: exported method GoBlockGenerator.DefElseIf should have comment or be unexported (golint)
    • Line 382: warning: exported method GoBlockGenerator.DefRangeBegin should have comment or be unexported (golint)
    • Line 407: warning: exported method GoBlockGenerator.ReturnCaller should have comment or be unexported (golint)
    • Line 416: warning: exported method GoBlockGenerator.Defer should have comment or be unexported (golint)
    • Line 426: warning: exported method GoBlockGenerator.Else should have comment or be unexported (golint)
    • Line 430: warning: exported method GoBlockGenerator.CloseIf should have comment or be unexported (golint)
    • Line 434: warning: exported method GoBlockGenerator.CloseRange should have comment or be unexported (golint)
    • Line 438: warning: exported method GoBlockGenerator.AnonymousGoFunc should have comment or be unexported (golint)
    • Line 447: warning: exported method GoBlockGenerator.TypeSwitch should have comment or be unexported (golint)
    • Line 456: warning: exported method GoBlockGenerator.SliceLiteral should have comment or be unexported (golint)
    • Line 465: warning: exported method GoBlockGenerator.InitStruct should have comment or be unexported (golint)
    • xservice/internal/xproto/typesmap/typesmap.go
    • Line 25: warning: exported type Registry should have comment or be unexported (golint)
    • Line 33: warning: exported function New should have comment or be unexported (golint)
    • Line 57: warning: exported method Registry.FileComments should have comment or be unexported (golint)
    • Line 61: warning: exported method Registry.ServiceComments should have comment or be unexported (golint)
    • Line 71: warning: exported method Registry.MethodComments should have comment or be unexported (golint)
    • Line 86: warning: exported method Registry.MethodInputDefinition should have comment or be unexported (golint)
    • Line 90: warning: exported method Registry.MethodOutputDefinition should have comment or be unexported (golint)
    • Line 94: warning: exported method Registry.MessageDefinition should have comment or be unexported (golint)
    • Line 98: warning: exported type MessageDefinition should have comment or be unexported (golint)
    • xservice/internal/xgenerator/types/prototype.go
    • Line 25: warning: exported type PrototypeMetadata should have comment or be unexported (golint)
    • Line 32: warning: exported type PrototypeGenerator should have comment or be unexported (golint)
    • Line 37: warning: exported function NewGoFuncPrototype should have comment or be unexported (golint)
    • Line 68: warning: exported method PrototypeGenerator.Render should have comment or be unexported (golint)
    • xservice/internal/xgenerator/types/anonymous_func.go
    • Line 16: warning: exported type AnonymousFuncGeneratorMetaData should have comment or be unexported (golint)
    • Line 27: warning: exported type AnonymousFuncGenerator should have comment or be unexported (golint)
    • Line 33: warning: exported const AnonymousfuncTplName should have comment or be unexported (golint)
    • Line 34: warning: exported const AnonymousfuncTpl should have comment or be unexported (golint)
    • Line 41: warning: exported function NewAnonymousGoFunc should have comment or be unexported (golint)
    • Line 71: warning: exported method AnonymousFuncGenerator.Render should have comment or be unexported (golint)
    • xservice/framework/xhttp/xhttp.go
    • Line 3: warning: exported const ContentTypeHeader should have comment or be unexported (golint)
    • Line 5: warning: exported const ApplicationJson should have comment or be unexported (golint)
    • Line 7: warning: exported const ApplicationProtobuf should have comment or be unexported (golint)
    • xservice/internal/xgenerator/types/comment.go
    • Line 28: warning: exported type CommentMetaData should have comment or be unexported (golint)
    • Line 32: warning: exported type CommentGenerator should have comment or be unexported (golint)
    • Line 37: warning: exported function NewGoComment should have comment or be unexported (golint)
    • Line 46: warning: exported method CommentGenerator.P should have comment or be unexported (golint)
    • Line 50: warning: exported method CommentGenerator.Pf should have comment or be unexported (golint)
    • Line 54: warning: exported method CommentGenerator.Render should have comment or be unexported (golint)
    • xservice/generator/proto/go/api.go
    • Line 38: warning: exported const ServeJSON should have comment (or a comment on this block) or be unexported (golint)
    • Line 42: warning: exported type API should have comment or be unexported (golint)
    • Line 65: warning: exported function NewAPIGenerator should have comment or be unexported (golint)
    • Line 74: warning: exported function FilesToGenerate should have comment or be unexported (golint)
    • Line 90: warning: exported method API.Generate should have comment or be unexported (golint)
    • Line 1015: warning: error var EmptyComment should have name of the form ErrFoo (golint)
    • Line 1015: warning: exported var EmptyComment should have comment or be unexported (golint)
    • xservice/framework/transport/transport.go
    • Line 77: warning: comment on exported function WriteErrorAndTriggerHooks should be of the form "WriteErrorAndTriggerHooks ..." (golint)
    • Line 101: warning: comment on exported function UrlBase should be of the form "UrlBase ..." (golint)
    • Line 116: warning: comment on exported function Closebody should be of the form "Closebody ..." (golint)
    • Line 170: warning: comment on exported function DoProtobufferRequest should be of the form "DoProtobufferRequest ..." (golint)
    • Line 219: warning: comment on exported function DoJSONRequest should be of the form "DoJSONRequest ..." (golint)
    • Line 265: warning: comment on exported function WithoutRedirects should be of the form "WithoutRedirects ..." (golint)
    • Line 365: warning: comment on exported function CallRequestReceived should be of the form "CallRequestReceived ..." (golint)
    • Line 373: warning: comment on exported function CallRequestRouted should be of the form "CallRequestRouted ..." (golint)
    • Line 381: warning: comment on exported function CallResponsePrepared should be of the form "CallResponsePrepared ..." (golint)
    • Line 389: warning: comment on exported function CallResponseSent should be of the form "CallResponseSent ..." (golint)
    • Line 397: warning: comment on exported function CallError should be of the form "CallError ..." (golint)
    • Line 408: warning: exported function EncodeJSONResponse should have comment or be unexported (golint)
    • Line 432: warning: exported function DecodeJSONRequest should have comment or be unexported (golint)
    • Line 442: warning: exported function EncodePROTOResponse should have comment or be unexported (golint)
    • Line 458: warning: exported function DecodePROTORequest should have comment or be unexported (golint)
    • xservice/internal/xgenerator/types/interface.go
    • Line 32: warning: exported type InterfaceMetadata should have comment or be unexported (golint)
    • Line 38: warning: exported type InterfacePrototypeMetadata should have comment or be unexported (golint)
    • Line 45: warning: exported type InterfaceGenerator should have comment or be unexported (golint)
    • Line 50: warning: exported function NewGoInterface should have comment or be unexported (golint)
    • Line 70: warning: exported method InterfaceGenerator.Prototype should have comment or be unexported (golint)
    • Line 98: warning: exported method InterfaceGenerator.Render should have comment or be unexported (golint)
    • xservice/internal/xgenerator/types/method.go
    • Line 16: warning: exported type MethodGeneratorMetaData should have comment or be unexported (golint)
    • Line 27: warning: exported type MethodGenerator should have comment or be unexported (golint)
    • Line 46: warning: exported function NewGoMethod should have comment or be unexported (golint)
    • Line 94: warning: exported method MethodGenerator.Render should have comment or be unexported (golint)
    • xservice/framework/xcontext/ctx.go
    • Line 30: warning: exported const MethodNameKey should have comment (or a comment on this block) or be unexported (golint)
    • Line 38: warning: exported function WithMethodName should have comment or be unexported (golint)
    • Line 42: warning: exported function WithServiceName should have comment or be unexported (golint)
    • Line 46: warning: exported function WithPackageName should have comment or be unexported (golint)
    • Line 50: warning: exported function WithStatusCode should have comment or be unexported (golint)
    • Line 54: warning: exported function WithResponseWriter should have comment or be unexported (golint)
    • Line 124: warning: exported function HTTPRequestHeaders should have comment or be unexported (golint)
    • xservice/internal/xgenerator/types/genutil.go
    • Line 70: warning: exported function CamelCase should have comment or be unexported (golint)
    • Line 123: warning: exported function ValueList should have comment or be unexported (golint)
    • Line 156: warning: exported function ExportedIdentifier should have comment or be unexported (golint)
    • Line 160: warning: exported function UnexportedIdentifier should have comment or be unexported (golint)
    • Line 164: warning: exported function Identifier should have comment or be unexported (golint)
    • Line 173: warning: exported function UnTitle should have comment or be unexported (golint)
    • Line 183: warning: exported function GoFileName should have comment or be unexported (golint)
    • Line 259: warning: exported function StatusText should have comment or be unexported (golint)
    • Line 267: warning: exported function ValidateIdent should have comment or be unexported (golint)
    • Line 274: warning: exported function ValidateIdents should have comment or be unexported (golint)
    • Line 283: warning: exported function ValidateParameters should have comment or be unexported (golint)
    • Line 306: warning: exported function ValidateOperation should have comment or be unexported (golint)
    • Line 313: warning: exported function ValidateIfOperation should have comment or be unexported (golint)
    • Line 327: warning: exported function NewGeneratorErrorString should have comment or be unexported (golint)
    • Line 334: warning: exported type GeneratorErrorString should have comment or be unexported (golint)
    • Line 343: warning: exported function NewGeneratorError should have comment or be unexported (golint)
    • Line 350: warning: exported type GeneratorError should have comment or be unexported (golint)
    • xservice/internal/xgenerator/types/file.go
    • Line 76: warning: exported type Type should have comment or be unexported (golint)
    • Line 81: warning: exported type Generator should have comment or be unexported (golint)
    • Line 85: warning: exported type ImportDecl should have comment or be unexported (golint)
    • Line 107: warning: exported type FileGenerator should have comment or be unexported (golint)
    • Line 112: warning: exported function NewGoFile should have comment or be unexported (golint)
    • Line 138: warning: exported method FileGenerator.Type should have comment or be unexported (golint)
    • Line 149: warning: exported method FileGenerator.HeaderComment should have comment or be unexported (golint)
    • Line 160: warning: exported method FileGenerator.Import should have comment or be unexported (golint)
    • Line 174: warning: exported method FileGenerator.TypesWithoutGroup should have comment or be unexported (golint)
    • Line 186: warning: exported method FileGenerator.Func should have comment or be unexported (golint)
    • Line 197: warning: exported method FileGenerator.Closure should have comment or be unexported (golint)
    • Line 208: warning: exported method FileGenerator.Const should have comment or be unexported (golint)
    • Line 223: warning: exported method FileGenerator.Var should have comment or be unexported (golint)
    • Line 228: warning: exported method FileGenerator.Prototype should have comment or be unexported (golint)
    • Line 243: warning: exported method FileGenerator.Interface should have comment or be unexported (golint)
    • Line 258: warning: exported method FileGenerator.TypesWithMethods should have comment or be unexported (golint)
    • Line 279: warning: exported method FileGenerator.Render should have comment or be unexported (golint)
    • Line 287: warning: exported method FileGenerator.RenderBytes should have comment or be unexported (golint)
    • Line 306: warning: exported method FileGenerator.RenderAndFormatCode should have comment or be unexported (golint)
    • Line 332: warning: exported method FileGenerator.GetFileName should have comment or be unexported (golint)
    • xservice/internal/xgenerator/types/go.go
    • Line 28: warning: exported const CallerTpl should have comment (or a comment on this block) or be unexported (golint)
    • Line 53: warning: exported type GoGenerator should have comment or be unexported (golint)
    • Line 58: warning: exported method GoGenerator.InitTemplate should have comment or be unexported (golint)
    • Line 65: warning: exported method GoGenerator.OverwriteTemplate should have comment or be unexported (golint)
    • Line 94: warning: exported method GoGenerator.RenderBytesData should have comment or be unexported (golint)
    • Line 123: warning: exported method GoGenerator.PrepareComment should have comment or be unexported (golint)
    • xservice/internal/xgenerator/types/slice_literal.go
    • Line 27: warning: exported type SliceLiteralMetadata should have comment or be unexported (golint)
    • Line 34: warning: exported type SliceLiteralGenerator should have comment or be unexported (golint)
    • Line 39: warning: exported function NewGoSliceLiteral should have comment or be unexported (golint)
    • Line 72: warning: exported method SliceLiteralGenerator.Append should have comment or be unexported (golint)
    • Line 76: warning: exported method SliceLiteralGenerator.Render should have comment or be unexported (golint)
    • xservice/internal/xgenerator/types/struct.go
    • Line 42: warning: exported type StructTmplValues should have comment or be unexported (golint)
    • Line 49: warning: exported type StructFieldTmplValues should have comment or be unexported (golint)
    • Line 56: warning: exported type StructGenerator should have comment or be unexported (golint)
    • Line 62: warning: exported function NewGoStruct should have comment or be unexported (golint)
    • Line 94: warning: exported method StructGenerator.Type should have comment or be unexported (golint)
    • Line 113: warning: exported method StructGenerator.AddExportedField should have comment or be unexported (golint)
    • Line 141: warning: exported method StructGenerator.Composition should have comment or be unexported (golint)
    • Line 159: warning: exported method StructGenerator.AddUnexportedField should have comment or be unexported (golint)
    • Line 188: warning: exported method StructGenerator.AddMethod should have comment or be unexported (golint)
    • Line 192: warning: exported method StructGenerator.GetMethods should have comment or be unexported (golint)
    • Line 196: warning: exported method StructGenerator.Render should have comment or be unexported (golint)
    • xservice/internal/xgenerator/types/type_reference.go
    • Line 147: warning: comment on exported var StringPointer should be of the form "StringPointer ..." (golint)
    • Line 151: warning: comment on exported var BoolPointer should be of the form "BoolPointer ..." (golint)
    • Line 155: warning: comment on exported var IntPointer should be of the form "IntPointer ..." (golint)
    • Line 159: warning: comment on exported var Int8Pointer should be of the form "Int8Pointer ..." (golint)
    • Line 163: warning: comment on exported var Int16Pointer should be of the form "Int16Pointer ..." (golint)
    • Line 167: warning: comment on exported var Int32Pointer should be of the form "Int32Pointer ..." (golint)
    • Line 171: warning: comment on exported var Int64Pointer should be of the form "Int64Pointer ..." (golint)
    • Line 173: warning: comment on exported var Uint should be of the form "Uint ..." (golint)
    • Line 175: warning: comment on exported var UintPointer should be of the form "UintPointer ..." (golint)
    • Line 177: warning: comment on exported var Uint8 should be of the form "Uint8 ..." (golint)
    • Line 179: warning: comment on exported var Uint8Pointer should be of the form "Uint8Pointer ..." (golint)
    • Line 181: warning: comment on exported var Uint16 should be of the form "Uint16 ..." (golint)
    • Line 183: warning: comment on exported var Uint16Pointer should be of the form "Uint16Pointer ..." (golint)
    • Line 185: warning: comment on exported var Uint32 should be of the form "Uint32 ..." (golint)
    • Line 187: warning: comment on exported var Uint32Pointer should be of the form "Uint32Pointer ..." (golint)
    • Line 189: warning: comment on exported var Uint64 should be of the form "Uint64 ..." (golint)
    • Line 191: warning: comment on exported var Uint64Pointer should be of the form "Uint64Pointer ..." (golint)
    • Line 194: warning: comment on exported var Uintptr should be of the form "Uintptr ..." (golint)
    • Line 213: warning: exported function UnsafePointerReference should have comment or be unexported (golint)
    • Line 217: warning: exported type Parameter should have comment or be unexported (golint)
    • Line 222: warning: exported function NewParameterWithTypeReference should have comment or be unexported (golint)
    • Line 229: warning: exported function NewParameterWithTypeReferenceFromInstance should have comment or be unexported (golint)
    • Line 236: warning: exported function NewParameterWithUnsafeTypeReference should have comment or be unexported (golint)
    • xservice/framework/errors/error.go
    • Line 299: warning: comment on exported type WrappedErr should be of the form "WrappedErr ..." (with optional leading article) (golint)
    • Line 309: warning: exported method WrappedErr.Code should have comment or be unexported (golint)
    • Line 310: warning: exported method WrappedErr.Msg should have comment or be unexported (golint)
    • Line 311: warning: exported method WrappedErr.Meta should have comment or be unexported (golint)
    • Line 312: warning: exported method WrappedErr.MetaMap should have comment or be unexported (golint)
    • Line 314: warning: exported method WrappedErr.WithMeta should have comment or be unexported (golint)
    • Line 320: warning: exported method WrappedErr.Cause should have comment or be unexported (golint)
    • Line 329: warning: exported function WrapErr should have comment or be unexported (golint)
    • Line 338: warning: comment on exported function BadRouteError should be of the form "BadRouteError ..." (golint)
    • xservice/internal/xgenerator/types/colsure.go
    • Line 18: warning: exported type ClosureGeneratorMetaData should have comment or be unexported (golint)
    • Line 29: warning: exported type ClosureGenerator should have comment or be unexported (golint)
    • Line 54: warning: exported function NewClosureFunc should have comment or be unexported (golint)
    • Line 92: warning: exported method ClosureGenerator.Render 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.


ineffassign94%

IneffAssign detects ineffectual assignments in Go code.


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!