Edge-home-orchestration-go: Comments to the exported functions and others

Created on 9 Aug 2021  路  2Comments  路  Source: lf-edge/edge-home-orchestration-go

We need to add or revise comments to resolve golint warnings.

  • [x] internal/controller/storagemgr/
  • [x] internal/common/resourceutil/cpu/
  • [x] internal/common/types/configuremgrtypes/
  • [x] internal/controller/discoverymgr/
  • [x] internal/controller/scoringmgr/
  • [x] internal/controller/servicemgr/
  • [x] internal/db/bolt/
  • [x] internal/db/helper/
  • [x] internal/orchestrationapi/
  • [x] internal/restinterface/externalhandler/
  • [x] internal/restinterface/internalhandler/
  • [x] internal/restinterface/resthelper/
  • [x] internal/restinterface/route/route.go
  • [x] internal/controller/securemgr/
  • [x] internal/restinterface/route/tlsserver/

Log of make lint

--------------------------------------
  Analysis source code golint & go vet
--------------------------------------
golint ./internal/...
internal/common/resourceutil/cpu/cpu.go:13:2: exported const USER should have comment (or a comment on this block) or be unexported
internal/common/resourceutil/cpu/cpu.go:26:2: don't use ALL_CAPS in Go names; use CamelCase
internal/common/resourceutil/cpu/cpu.go:26:2: exported const CPU_IDLE should have comment (or a comment on this block) or be unexported
internal/common/resourceutil/cpu/cpu.go:27:2: don't use ALL_CAPS in Go names; use CamelCase
internal/common/resourceutil/cpu/cpu.go:28:2: don't use ALL_CAPS in Go names; use CamelCase
internal/common/resourceutil/cpu/cpu.go:31:6: exported type InfoStat should have comment or be unexported
internal/common/resourceutil/cpu/cpu.go:80:1: exported function Percent should have comment or be unexported
internal/common/resourceutil/cpu/cpu.go:114:1: exported function Info should have comment or be unexported
internal/common/types/configuremgrtypes/configuremgrtypes.go:1:1: package comment should be of the form "Package configuremgrtypes ..."
internal/common/types/configuremgrtypes/configuremgrtypes.go:19:6: exported type ServiceInfo should have comment or be unexported
internal/controller/discoverymgr/discovery.go:532:1: exported function SetNetwotkArgument should have comment or be unexported
internal/controller/scoringmgr/scoringmgr.go:30:2: exported const InvalidScore should have comment (or a comment on this block) or be unexported
internal/controller/securemgr/authenticator/authenticator.go:38:6: type name will be used as authenticator.AuthenticatorImpl by other packages, and that stutters; consider calling this Impl
internal/controller/securemgr/authorizer/authorizer.go:33:6: type name will be used as authorizer.AuthorizerImpl by other packages, and that stutters; consider calling this Impl
internal/controller/securemgr/verifier/verifier.go:41:6: type name will be used as verifier.VerifierImpl by other packages, and that stutters; consider calling this Impl
internal/controller/securemgr/verifier/verifier.go:72:6: type name will be used as verifier.VerifierConf by other packages, and that stutters; consider calling this Conf
internal/controller/servicemgr/types.go:44:2: exported const ConstKeyRequester should have comment (or a comment on this block) or be unexported
internal/controller/servicemgr/executor/androidexecutor/androidexecutor.go:39:1: comment on exported type ExecuteCallback should be of the form "ExecuteCallback ..." (with optional leading article)
internal/controller/servicemgr/executor/androidexecutor/androidexecutor.go:60:1: exported method AndroidExecutor.SetExecuteCallback should have comment or be unexported
internal/controller/storagemgr/storage.go:1:1: package comment should be of the form "Package storagemgr ..."
internal/controller/storagemgr/storage.go:36:6: exported type Storage should have comment or be unexported
internal/controller/storagemgr/storage.go:42:1: comment on exported type StorageImpl should be of the form "StorageImpl ..." (with optional leading article)
internal/controller/storagemgr/storage.go:133:2: var propertyJson should be propertyJSON
internal/controller/storagemgr/config/toml.go:24:6: exported type Writable should have comment or be unexported
internal/controller/storagemgr/config/toml.go:28:6: exported type Service should have comment or be unexported
internal/controller/storagemgr/config/toml.go:39:6: exported type Registry should have comment or be unexported
internal/controller/storagemgr/config/toml.go:48:6: exported type Device should have comment or be unexported
internal/controller/storagemgr/config/toml.go:59:6: exported type ProtocolProperties should have comment or be unexported
internal/controller/storagemgr/config/toml.go:61:6: exported type DeviceProperties should have comment or be unexported
internal/controller/storagemgr/config/toml.go:69:6: exported type DeviceList should have comment or be unexported
internal/controller/storagemgr/config/toml.go:71:6: exported type Client should have comment or be unexported
internal/controller/storagemgr/config/toml.go:78:6: exported type Clients should have comment or be unexported
internal/controller/storagemgr/config/toml.go:80:6: exported type Toml should have comment or be unexported
internal/controller/storagemgr/config/toml.go:93:1: exported function SetWritable should have comment or be unexported
internal/controller/storagemgr/config/toml.go:97:1: exported function SetService should have comment or be unexported
internal/controller/storagemgr/config/toml.go:109:1: exported function SetRegistry should have comment or be unexported
internal/controller/storagemgr/config/toml.go:119:1: exported function SetDevice should have comment or be unexported
internal/controller/storagemgr/config/toml.go:132:1: exported function SetDeviceList should have comment or be unexported
internal/controller/storagemgr/config/toml.go:141:1: exported function SetClients should have comment or be unexported
internal/controller/storagemgr/config/toml.go:153:1: exported function TomlMarshal should have comment or be unexported
internal/controller/storagemgr/config/yaml.go:24:6: exported type Yaml should have comment or be unexported
internal/controller/storagemgr/config/yaml.go:33:6: exported type DeviceResource should have comment or be unexported
internal/controller/storagemgr/config/yaml.go:39:6: exported type Property should have comment or be unexported
internal/controller/storagemgr/config/yaml.go:44:6: exported type PropertyDetail should have comment or be unexported
internal/controller/storagemgr/config/yaml.go:54:1: exported function SetYaml should have comment or be unexported
internal/controller/storagemgr/config/yaml.go:64:1: exported function YamlMarshal should have comment or be unexported
internal/controller/storagemgr/config/yaml_test.go:30:2: var testPropertyJson should be testPropertyJSON
internal/controller/storagemgr/error/errorconstants.go:23:2: exported const DSInitializeError should have comment (or a comment on this block) or be unexported
internal/controller/storagemgr/storagedriver/storagedriver.go:32:6: exported type StorageDriver should have comment or be unexported
internal/controller/storagemgr/storagedriver/storagedriver.go:68:1: comment on exported method StorageDriver.AddDevice should be of the form "AddDevice ..."
internal/controller/storagemgr/storagedriver/storagedriver.go:76:1: comment on exported method StorageDriver.UpdateDevice should be of the form "UpdateDevice ..."
internal/controller/storagemgr/storagedriver/storagedriver.go:83:1: comment on exported method StorageDriver.RemoveDevice should be of the form "RemoveDevice ..."
internal/controller/storagemgr/storagedriver/storagehandler.go:58:6: exported type StorageHandler should have comment or be unexported
internal/controller/storagemgr/storagedriver/storagehandler.go:65:1: exported function NewStorageHandler should have comment or be unexported
internal/controller/storagemgr/storagedriver/storagehandler.go:97:10: should not use basic type string as key in context.WithValue
internal/controller/storagemgr/storagedriver/storagehandler.go:146:2: var requestUrl should be requestURL
internal/db/bolt/common/common.go:22:1: exported function HasElem should have comment or be unexported
internal/db/bolt/configuration/configuration.go:1:1: package comment should be of the form "Package configuration ..."
internal/db/bolt/configuration/configuration.go:28:6: exported type Configuration should have comment or be unexported
internal/db/bolt/configuration/configuration.go:34:6: exported type DBInterface should have comment or be unexported
internal/db/bolt/configuration/configuration.go:42:6: exported type Query should have comment or be unexported
internal/db/bolt/configuration/configuration.go:51:1: exported method Query.Get should have comment or be unexported
internal/db/bolt/configuration/configuration.go:67:1: exported method Query.GetList should have comment or be unexported
internal/db/bolt/configuration/configuration.go:84:1: exported method Query.Set should have comment or be unexported
internal/db/bolt/configuration/configuration.go:97:1: exported method Query.Update should have comment or be unexported
internal/db/bolt/configuration/configuration.go:119:1: exported method Query.Delete should have comment or be unexported
internal/db/bolt/network/network.go:1:1: package comment should be of the form "Package network ..."
internal/db/bolt/network/network.go:29:6: exported type NetworkInfo should have comment or be unexported
internal/db/bolt/network/network.go:29:6: type name will be used as network.NetworkInfo by other packages, and that stutters; consider calling this Info
internal/db/bolt/network/network.go:35:6: exported type DBInterface should have comment or be unexported
internal/db/bolt/network/network.go:44:6: exported type Query should have comment or be unexported
internal/db/bolt/network/network.go:53:1: exported method Query.Get should have comment or be unexported
internal/db/bolt/network/network.go:69:1: exported method Query.GetList should have comment or be unexported
internal/db/bolt/network/network.go:86:1: exported method Query.GetIDWithIP should have comment or be unexported
internal/db/bolt/network/network.go:101:1: exported method Query.Set should have comment or be unexported
internal/db/bolt/network/network.go:114:1: exported method Query.Update should have comment or be unexported
internal/db/bolt/network/network.go:142:1: exported method Query.Delete should have comment or be unexported
internal/db/bolt/resource/resource.go:29:6: exported type ResourceInfo should have comment or be unexported
internal/db/bolt/resource/resource.go:29:6: type name will be used as resource.ResourceInfo by other packages, and that stutters; consider calling this Info
internal/db/bolt/resource/resource.go:34:6: exported type DBInterface should have comment or be unexported
internal/db/bolt/resource/resource.go:40:6: exported type Query should have comment or be unexported
internal/db/bolt/resource/resource.go:49:1: exported method Query.Get should have comment or be unexported
internal/db/bolt/resource/resource.go:65:1: exported method Query.Set should have comment or be unexported
internal/db/bolt/resource/resource.go:78:1: exported method Query.Delete should have comment or be unexported
internal/db/bolt/service/service.go:30:6: exported type ServiceInfo should have comment or be unexported
internal/db/bolt/service/service.go:30:6: type name will be used as service.ServiceInfo by other packages, and that stutters; consider calling this Info
internal/db/bolt/service/service.go:35:6: exported type DBInterface should have comment or be unexported
internal/db/bolt/service/service.go:43:6: exported type Query should have comment or be unexported
internal/db/bolt/service/service.go:52:1: exported method Query.Get should have comment or be unexported
internal/db/bolt/service/service.go:68:1: exported method Query.GetList should have comment or be unexported
internal/db/bolt/service/service.go:85:1: exported method Query.Set should have comment or be unexported
internal/db/bolt/service/service.go:98:1: exported method Query.Update should have comment or be unexported
internal/db/bolt/service/service.go:123:1: exported method Query.Delete should have comment or be unexported
internal/db/bolt/system/system.go:30:2: exported const ID should have comment (or a comment on this block) or be unexported
internal/db/bolt/system/system.go:35:6: exported type SystemInfo should have comment or be unexported
internal/db/bolt/system/system.go:35:6: type name will be used as system.SystemInfo by other packages, and that stutters; consider calling this Info
internal/db/bolt/system/system.go:40:6: exported type DBInterface should have comment or be unexported
internal/db/bolt/system/system.go:46:6: exported type Query should have comment or be unexported
internal/db/bolt/system/system.go:55:1: exported method Query.Get should have comment or be unexported
internal/db/bolt/system/system.go:71:1: exported method Query.Set should have comment or be unexported
internal/db/bolt/system/system.go:84:1: exported method Query.Delete should have comment or be unexported
internal/db/bolt/wrapper/wrapper.go:1:1: package comment should be of the form "Package wrapper ..."
internal/db/bolt/wrapper/wrapper.go:108:1: exported method BoltDB.Put should have comment or be unexported
internal/db/bolt/wrapper/wrapper.go:124:1: exported method BoltDB.List should have comment or be unexported
internal/db/bolt/wrapper/wrapper.go:146:1: exported method BoltDB.Delete should have comment or be unexported
internal/db/helper/helper.go:37:2: struct field Id should be ID
internal/orchestrationapi/orchestrationapi.go:72:6: exported type RequestServiceInfo should have comment or be unexported
internal/orchestrationapi/orchestrationapi.go:78:6: exported type ReqeustService should have comment or be unexported
internal/orchestrationapi/orchestrationapi.go:86:6: exported type TargetInfo should have comment or be unexported
internal/orchestrationapi/orchestrationapi.go:91:6: exported type ResponseService should have comment or be unexported
internal/orchestrationapi/orchestrationapi.go:98:2: exported const ErrorNone should have comment (or a comment on this block) or be unexported
internal/restinterface/externalhandler/senderresolver/senderresolver.go:42:1: exported function GetNameByPort should have comment or be unexported
internal/restinterface/internalhandler/internalhandler.go:120:1: exported method Handler.SetCertificateFilePath should have comment or be unexported
internal/restinterface/resthelper/helper.go:42:6: exported type RestHelperWithCertificateSetter should have comment or be unexported
internal/restinterface/resthelper/helper.go:42:6: type name will be used as resthelper.RestHelperWithCertificateSetter by other packages, and that stutters; consider calling this WithCertificateSetter
internal/restinterface/resthelper/helper.go:89:1: exported function GetHelperWithCertificate should have comment or be unexported
internal/restinterface/resthelper/client/client.go:24:6: exported type Requester should have comment or be unexported
internal/restinterface/resthelper/client/httphelper/httphelper.go:28:6: exported type HttpHelper should have comment or be unexported
internal/restinterface/resthelper/client/httphelper/httphelper.go:28:6: type HttpHelper should be HTTPHelper
internal/restinterface/resthelper/client/httphelper/httphelper.go:42:1: exported method HttpHelper.Do should have comment or be unexported
internal/restinterface/resthelper/client/tlshelper/tlshelper.go:38:6: exported type TLSHelper should have comment or be unexported
internal/restinterface/resthelper/client/tlshelper/tlshelper.go:75:1: exported method TLSHelper.Do should have comment or be unexported
internal/restinterface/route/route.go:41:2: exported const ConstInternalPort should have comment (or a comment on this block) or be unexported
internal/restinterface/route/route.go:67:1: comment on exported function NewRestRouterWithCerti should be of the form "NewRestRouterWithCerti ..."
internal/restinterface/route/tlsserver/tlsserver.go:33:6: exported type TLSServerListener should have comment or be unexported
internal/restinterface/route/tlsserver/tlsserver.go:33:6: type name will be used as tlsserver.TLSServerListener by other packages, and that stutters; consider calling this Listener
internal/restinterface/route/tlsserver/tlsserver.go:37:6: exported type TLSServer should have comment or be unexported
internal/restinterface/route/tlsserver/tlsserver.go:67:1: exported method TLSServer.ListenAndServe should have comment or be unexported

_Originally posted by @tdrozdovsky in https://github.com/lf-edge/edge-home-orchestration-go/issues/349#issuecomment-894176074_

bug help wanted high priority

Most helpful comment

@tdrozdovsky PTAL - internal/controller/securemgr/ AND internal/restinterface/route/tlsserver/ since they are related to security.
@suresh-lc PTAL for the remainders. 馃槃

All 2 comments

@tdrozdovsky PTAL - internal/controller/securemgr/ AND internal/restinterface/route/tlsserver/ since they are related to security.
@suresh-lc PTAL for the remainders. 馃槃

Fixed

Was this page helpful?
0 / 5 - 0 ratings