Preparing report...

Report for openpitrix.io/libconfd

A+    Excellent!    Found 18 issues across 31 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!


golint45%

Golint is a linter for Go source code.

    • /openpitrix.io/libconfd/kvstore_test.go
    • Line 13: warning: don't use underscores in Go names; var tKVStore_gettests should be tKVStoreGettests (golint)
    • Line 37: warning: don't use underscores in Go names; var tKVStore_getvtests should be tKVStoreGetvtests (golint)
    • Line 85: warning: don't use underscores in Go names; var tKVStore_getalltestinput should be tKVStoreGetalltestinput (golint)
    • Line 97: warning: don't use underscores in Go names; var tKVStore_getalltests should be tKVStoreGetalltests (golint)
    • Line 171: warning: don't use underscores in Go names; var tKVStore_listTestMap should be tKVStoreListTestMap (golint)
    • /openpitrix.io/libconfd/backend.go
    • Line 14: warning: exported type BackendConfig should have comment or be unexported (golint)
    • Line 28: warning: exported method BackendConfig.Clone should have comment or be unexported (golint)
    • Line 34: warning: exported type BackendClient should have comment or be unexported (golint)
    • Line 42: warning: exported function MustNewBackendClient should have comment or be unexported (golint)
    • Line 50: warning: exported function NewBackendClient should have comment or be unexported (golint)
    • Line 64: warning: exported function MustLoadBackendConfig should have comment or be unexported (golint)
    • Line 72: warning: exported function LoadBackendConfig should have comment or be unexported (golint)
    • Line 81: warning: exported function LoadBackendConfigFromJsonString should have comment or be unexported (golint)
    • Line 89: warning: exported function RegisterBackendClient should have comment or be unexported (golint)
    • /openpitrix.io/libconfd/kvstore.go
    • Line 15: warning: exported type KVPair should have comment or be unexported (golint)
    • Line 31: warning: comment on exported function NewKVStore should be of the form "NewKVStore ..." (golint)
    • Line 36: warning: comment on exported method KVStore.Del should be of the form "Del ..." (golint)
    • Line 104: warning: exported method KVStore.GetAllValues should have comment or be unexported (golint)
    • Line 121: warning: exported method KVStore.List should have comment or be unexported (golint)
    • Line 151: warning: exported method KVStore.ListDir should have comment or be unexported (golint)
    • Line 178: warning: receiver name s should be consistent with previous receiver name p for KVStore (golint)
    • Line 185: warning: exported method KVStore.Purge should have comment or be unexported (golint)
    • Line 185: warning: receiver name s should be consistent with previous receiver name p for KVStore (golint)
    • Line 194: warning: receiver name should not be an underscore, omit the name if it is unused (golint)
    • Line 198: warning: receiver name should not be an underscore, omit the name if it is unused (golint)
    • Line 202: warning: receiver name should not be an underscore, omit the name if it is unused (golint)
    • /openpitrix.io/libconfd/backends_toml.go
    • Line 14: warning: exported const TomlBackendType should have comment or be unexported (golint)
    • Line 18: warning: exported type TomlBackend should have comment or be unexported (golint)
    • Line 32: warning: exported function NewTomlBackendClient should have comment or be unexported (golint)
    • Line 37: warning: exported method TomlBackend.Close should have comment or be unexported (golint)
    • Line 37: warning: receiver name should not be an underscore, omit the name if it is unused (golint)
    • Line 41: warning: exported method TomlBackend.Type should have comment or be unexported (golint)
    • Line 41: warning: receiver name should not be an underscore, omit the name if it is unused (golint)
    • Line 45: warning: exported method TomlBackend.WatchEnabled should have comment or be unexported (golint)
    • Line 45: warning: receiver name should not be an underscore, omit the name if it is unused (golint)
    • Line 49: warning: exported method TomlBackend.WatchPrefix should have comment or be unexported (golint)
    • Line 49: warning: receiver name should not be an underscore, omit the name if it is unused (golint)
    • Line 53: warning: exported method TomlBackend.GetValues should have comment or be unexported (golint)
    • /openpitrix.io/libconfd/config.go
    • Line 18: warning: exported type Config should have comment or be unexported (golint)
    • Line 120: warning: exported function MustLoadConfig should have comment or be unexported (golint)
    • Line 128: warning: exported function LoadConfig should have comment or be unexported (golint)
    • Line 144: warning: exported function LoadConfigFromJsonString should have comment or be unexported (golint)
    • Line 157: warning: exported method Config.Valid should have comment or be unexported (golint)
    • Line 176: warning: exported method Config.Save should have comment or be unexported (golint)
    • Line 194: warning: exported method Config.Clone should have comment or be unexported (golint)
    • Line 208: warning: exported method Config.GetConfigDir should have comment or be unexported (golint)
    • Line 212: warning: exported method Config.GetTemplateDir should have comment or be unexported (golint)
    • Line 216: warning: exported method Config.GetDefaultTemplateOutputDir should have comment or be unexported (golint)
    • /openpitrix.io/libconfd/resource.go
    • Line 91: warning: exported function ListTemplateResource should have comment or be unexported (golint)
    • Line 124: warning: exported function LoadTemplateResourceFile should have comment or be unexported (golint)
    • Line 144: warning: exported method TemplateResource.TomlString should have comment or be unexported (golint)
    • Line 156: warning: exported method TemplateResource.SaveFile should have comment or be unexported (golint)
    • /openpitrix.io/libconfd/options.go
    • Line 11: warning: exported type Options should have comment or be unexported (golint)
    • Line 20: warning: exported function WithOnetimeMode should have comment or be unexported (golint)
    • Line 26: warning: exported function WithIntervalMode should have comment or be unexported (golint)
    • Line 33: warning: exported function WithInterval should have comment or be unexported (golint)
    • Line 39: warning: exported function WithWatchMode should have comment or be unexported (golint)
    • Line 46: warning: exported function WithFuncMap should have comment or be unexported (golint)
    • Line 59: warning: exported function WithAbsKeyAdjuster should have comment or be unexported (golint)
    • Line 65: warning: exported function WithFuncMapUpdater should have comment or be unexported (golint)
    • Line 71: warning: exported function WithHookOnCheckCmdDone should have comment or be unexported (golint)
    • Line 77: warning: exported function WithHookOnReloadCmdDone should have comment or be unexported (golint)
    • Line 83: warning: exported function WithHookOnUpdateDone should have comment or be unexported (golint)
    • /openpitrix.io/libconfd/processor.go
    • Line 14: warning: exported type Call should have comment or be unexported (golint)
    • Line 32: warning: exported type Processor should have comment or be unexported (golint)
    • Line 93: warning: exported function NewProcessor should have comment or be unexported (golint)
    • Line 130: warning: exported method Processor.Go should have comment or be unexported (golint)
    • Line 158: warning: exported method Processor.Run should have comment or be unexported (golint)
    • Line 176: warning: exported method Processor.Close should have comment or be unexported (golint)
    • /openpitrix.io/libconfd/application.go
    • Line 16: warning: exported type Application should have comment or be unexported (golint)
    • Line 21: warning: exported function NewApplication should have comment or be unexported (golint)
    • Line 28: warning: exported method Application.List should have comment or be unexported (golint)
    • Line 49: warning: exported method Application.Info should have comment or be unexported (golint)
    • Line 69: warning: exported method Application.Make should have comment or be unexported (golint)
    • Line 103: warning: exported method Application.GetValues should have comment or be unexported (golint)
    • Line 121: warning: exported method Application.Run should have comment or be unexported (golint)
    • /openpitrix.io/libconfd/backends_env_test.go
    • Line 30: warning: receiver name should not be an underscore, omit the name if it is unused (golint)
    • Line 34: warning: receiver name should not be an underscore, omit the name if it is unused (golint)
    • Line 38: warning: receiver name should not be an underscore, omit the name if it is unused (golint)
    • Line 43: warning: receiver name should not be an underscore, omit the name if it is unused (golint)
    • Line 78: warning: receiver name should not be an underscore, omit the name if it is unused (golint)
    • /openpitrix.io/libconfd/resource_processor.go
    • Line 21: warning: exported type TemplateResourceProcessor should have comment or be unexported (golint)
    • Line 36: warning: exported function MakeAllTemplateResourceProcessor should have comment or be unexported (golint)
    • Line 49: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 124: warning: comment on exported method TemplateResourceProcessor.Process should be of the form "Process ..." (golint)
    • Line 369: warning: receiver name should not be an underscore, omit the name if it is unused (golint)
    • Line 401: warning: receiver name should not be an underscore, omit the name if it is unused (golint)
    • /openpitrix.io/libconfd/tmpl_funcs.go
    • Line 24: warning: exported type TemplateFunc should have comment or be unexported (golint)
    • Line 32: warning: don't use underscores in Go names; var _TemplateFunc_initFuncMap should be _TemplateFuncInitFuncMap (golint)
    • Line 34: warning: exported function NewTemplateFunc should have comment or be unexported (golint)
    • Line 57: warning: exported method TemplateFunc.Exists should have comment or be unexported (golint)
    • Line 64: warning: exported method TemplateFunc.Ls should have comment or be unexported (golint)
    • Line 71: warning: exported method TemplateFunc.Lsdir should have comment or be unexported (golint)
    • Line 78: warning: exported method TemplateFunc.Get should have comment or be unexported (golint)
    • Line 90: warning: exported method TemplateFunc.Gets should have comment or be unexported (golint)
    • Line 102: warning: exported method TemplateFunc.Getv should have comment or be unexported (golint)
    • Line 115: warning: exported method TemplateFunc.Getvs should have comment or be unexported (golint)
    • Line 131: warning: exported method TemplateFunc.Cget should have comment or be unexported (golint)
    • Line 157: warning: exported method TemplateFunc.Cgets should have comment or be unexported (golint)
    • Line 184: warning: exported method TemplateFunc.Cgetv should have comment or be unexported (golint)
    • Line 209: warning: exported method TemplateFunc.Cgetvs should have comment or be unexported (golint)
    • Line 240: warning: exported method TemplateFunc.Base should have comment or be unexported (golint)
    • Line 240: warning: receiver name should not be an underscore, omit the name if it is unused (golint)
    • Line 244: warning: exported method TemplateFunc.Split should have comment or be unexported (golint)
    • Line 244: warning: receiver name should not be an underscore, omit the name if it is unused (golint)
    • Line 248: warning: exported method TemplateFunc.Json should have comment or be unexported (golint)
    • Line 248: warning: receiver name should not be an underscore, omit the name if it is unused (golint)
    • Line 258: warning: exported method TemplateFunc.JsonArray should have comment or be unexported (golint)
    • Line 258: warning: receiver name should not be an underscore, omit the name if it is unused (golint)
    • Line 268: warning: exported method TemplateFunc.Dir should have comment or be unexported (golint)
    • Line 268: warning: receiver name should not be an underscore, omit the name if it is unused (golint)
    • Line 274: warning: receiver name should not be an underscore, omit the name if it is unused (golint)
    • Line 291: warning: comment on exported method TemplateFunc.Getenv should be of the form "Getenv ..." (golint)
    • Line 294: warning: receiver name should not be an underscore, omit the name if it is unused (golint)
    • Line 304: warning: exported method TemplateFunc.Join should have comment or be unexported (golint)
    • Line 304: warning: receiver name should not be an underscore, omit the name if it is unused (golint)
    • Line 308: warning: exported method TemplateFunc.Datetime should have comment or be unexported (golint)
    • Line 308: warning: receiver name should not be an underscore, omit the name if it is unused (golint)
    • Line 312: warning: exported method TemplateFunc.ToUpper should have comment or be unexported (golint)
    • Line 312: warning: receiver name should not be an underscore, omit the name if it is unused (golint)
    • Line 316: warning: exported method TemplateFunc.ToLower should have comment or be unexported (golint)
    • Line 316: warning: receiver name should not be an underscore, omit the name if it is unused (golint)
    • Line 320: warning: exported method TemplateFunc.Contains should have comment or be unexported (golint)
    • Line 320: warning: receiver name should not be an underscore, omit the name if it is unused (golint)
    • Line 324: warning: exported method TemplateFunc.Replace should have comment or be unexported (golint)
    • Line 324: warning: receiver name should not be an underscore, omit the name if it is unused (golint)
    • Line 328: warning: exported method TemplateFunc.TrimSuffix should have comment or be unexported (golint)
    • Line 328: warning: receiver name should not be an underscore, omit the name if it is unused (golint)
    • Line 332: warning: exported method TemplateFunc.LookupIP should have comment or be unexported (golint)
    • Line 332: warning: receiver name should not be an underscore, omit the name if it is unused (golint)
    • Line 348: warning: exported method TemplateFunc.LookupIPV6 should have comment or be unexported (golint)
    • Line 348: warning: receiver name should not be an underscore, omit the name if it is unused (golint)
    • Line 358: warning: exported method TemplateFunc.LookupIPV4 should have comment or be unexported (golint)
    • Line 358: warning: receiver name should not be an underscore, omit the name if it is unused (golint)
    • Line 368: warning: exported method TemplateFunc.LookupSRV should have comment or be unexported (golint)
    • Line 368: warning: receiver name should not be an underscore, omit the name if it is unused (golint)
    • Line 383: warning: exported method TemplateFunc.FileExists should have comment or be unexported (golint)
    • Line 383: warning: receiver name should not be an underscore, omit the name if it is unused (golint)
    • Line 388: warning: exported method TemplateFunc.Base64Encode should have comment or be unexported (golint)
    • Line 388: warning: receiver name should not be an underscore, omit the name if it is unused (golint)
    • Line 392: warning: exported method TemplateFunc.Base64Decode should have comment or be unexported (golint)
    • Line 392: warning: receiver name should not be an underscore, omit the name if it is unused (golint)
    • Line 401: warning: exported method TemplateFunc.ParseBool should have comment or be unexported (golint)
    • Line 401: warning: receiver name should not be an underscore, omit the name if it is unused (golint)
    • Line 410: warning: comment on exported method TemplateFunc.Reverse should be of the form "Reverse ..." (golint)
    • Line 412: warning: receiver name should not be an underscore, omit the name if it is unused (golint)
    • Line 428: warning: exported method TemplateFunc.SortKVByLength should have comment or be unexported (golint)
    • Line 428: warning: receiver name should not be an underscore, omit the name if it is unused (golint)
    • Line 435: warning: exported method TemplateFunc.SortByLength should have comment or be unexported (golint)
    • Line 435: warning: receiver name should not be an underscore, omit the name if it is unused (golint)
    • Line 442: warning: exported method TemplateFunc.Add should have comment or be unexported (golint)
    • Line 442: warning: receiver name should not be an underscore, omit the name if it is unused (golint)
    • Line 445: warning: exported method TemplateFunc.Sub should have comment or be unexported (golint)
    • Line 445: warning: receiver name should not be an underscore, omit the name if it is unused (golint)
    • Line 448: warning: exported method TemplateFunc.Div should have comment or be unexported (golint)
    • Line 448: warning: receiver name should not be an underscore, omit the name if it is unused (golint)
    • Line 451: warning: exported method TemplateFunc.Mod should have comment or be unexported (golint)
    • Line 451: warning: receiver name should not be an underscore, omit the name if it is unused (golint)
    • Line 454: warning: exported method TemplateFunc.Mul should have comment or be unexported (golint)
    • Line 454: warning: receiver name should not be an underscore, omit the name if it is unused (golint)
    • Line 458: warning: comment on exported method TemplateFunc.Seq should be of the form "Seq ..." (golint)
    • Line 460: warning: receiver name should not be an underscore, omit the name if it is unused (golint)
    • Line 468: warning: exported method TemplateFunc.Atoi should have comment or be unexported (golint)
    • Line 468: warning: receiver name should not be an underscore, omit the name if it is unused (golint)
    • /openpitrix.io/libconfd/etcdv3/backend/etcdv3.go
    • Line 5: warning: don't use an underscore in package name (golint)
    • Line 25: warning: exported const Etcdv3BackendType should have comment or be unexported (golint)
    • Line 45: warning: exported function NewEtcdClient should have comment or be unexported (golint)
    • Line 183: warning: don't use underscores in Go names; method getValues_hookKeyAdjuster should be getValuesHookKeyAdjuster (golint)
    • /openpitrix.io/libconfd/metad/backend/metad.go
    • Line 11: warning: don't use an underscore in package name (golint)
    • Line 37: warning: exported const MetadBackendType should have comment or be unexported (golint)
    • Line 48: warning: exported type MetadClient should have comment or be unexported (golint)
    • Line 53: warning: exported type MetadConnection should have comment or be unexported (golint)
    • Line 60: warning: exported method MetadClient.Type should have comment or be unexported (golint)
    • Line 61: warning: exported method MetadClient.WatchEnabled should have comment or be unexported (golint)
    • Line 62: warning: exported method MetadClient.Close should have comment or be unexported (golint)
    • Line 64: warning: exported function NewMetadClient should have comment or be unexported (golint)
    • Line 137: warning: exported method MetadClient.GetValues should have comment or be unexported (golint)
    • Line 190: warning: exported method MetadClient.WatchPrefix should have comment or be unexported (golint)
    • Line 238: warning: should replace errors.New(fmt.Sprintf(...)) with fmt.Errorf(...) (golint)

gocyclo96%

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!