Preparing report...

Report for github.com/fanux/sealos

A    Great!    Found 57 issues across 80 files

Tweet

gofmt92%

Gofmt formats Go programs. We run gofmt -s on your code, where -s is for the "simplify" command


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!


golint30%

Golint is a linter for Go source code.

    • sealos/cmd/completion.go
    • Line 1: warning: package comment should be of the form "Package cmd ..." (golint)
    • Line 83: warning: exported function NewCmdCompletion should have comment or be unexported (golint)
    • Line 106: warning: exported function RunCompletion should have comment or be unexported (golint)
    • sealos/pkg/logger/log.go
    • Line 29: warning: comment on exported var LevelMap should be of the form "LevelMap ..." (golint)
    • Line 58: warning: exported const AdapterConsole should have comment (or a comment on this block) or be unexported (golint)
    • Line 63: warning: comment on exported type Logger should be of the form "Logger ..." (with optional leading article) (golint)
    • Line 70: warning: comment on exported function Register should be of the form "Register ..." (golint)
    • Line 95: warning: exported type LocalLogger should have comment or be unexported (golint)
    • Line 105: warning: exported function NewLogger should have comment or be unexported (golint)
    • Line 133: warning: exported method LocalLogger.SetLogger should have comment or be unexported (golint)
    • Line 133: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 176: warning: exported method LocalLogger.DelLogger should have comment or be unexported (golint)
    • Line 176: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 194: warning: comment on exported method LocalLogger.SetLogPath should be of the form "SetLogPath ..." (golint)
    • Line 195: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 198: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 223: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 255: warning: exported method LocalLogger.Fatal should have comment or be unexported (golint)
    • Line 255: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 260: warning: exported method LocalLogger.Panic should have comment or be unexported (golint)
    • Line 260: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 266: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 271: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 276: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 281: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 286: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 291: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 296: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 301: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 305: warning: exported method LocalLogger.Close should have comment or be unexported (golint)
    • Line 305: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 314: warning: exported method LocalLogger.Reset should have comment or be unexported (golint)
    • Line 314: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 321: warning: exported method LocalLogger.SetCallDepth should have comment or be unexported (golint)
    • Line 321: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 335: warning: exported function SetLogPath should have comment or be unexported (golint)
    • Line 339: warning: comment on exported function SetLogger should be of the form "SetLogger ..." (golint)
    • Line 430: warning: comment on exported function Debug should be of the form "Debug ..." (golint)
    • sealos/net/calico.go
    • Line 3: warning: exported type Calico should have comment or be unexported (golint)
    • Line 7: warning: exported method Calico.Manifests should have comment or be unexported (golint)
    • Line 25: warning: exported method Calico.Template should have comment or be unexported (golint)
    • Line 29: warning: exported const CalicoManifests should have comment or be unexported (golint)
    • sealos/cmd/upgrade.go
    • Line 1: warning: package comment should be of the form "Package cmd ..." (golint)
    • Line 37: warning: exported function NewUpgradeCmd should have comment or be unexported (golint)
    • Line 50: warning: exported function UpgradeCmdFunc should have comment or be unexported (golint)
    • Line 65: warning: exported function PreRunUpgradeCmdFunc should have comment or be unexported (golint)
    • sealos/net/cilium.go
    • Line 8: warning: exported type Cilium should have comment or be unexported (golint)
    • Line 12: warning: exported method Cilium.Manifests should have comment or be unexported (golint)
    • Line 37: warning: exported method Cilium.Template should have comment or be unexported (golint)
    • Line 41: warning: comment on exported const CiliumManifests should be of the form "CiliumManifests ..." (golint)
    • sealos/pkg/appmanager/deleteapp.go
    • Line 10: warning: exported type DeleteFlags should have comment or be unexported (golint)
    • Line 17: warning: exported function GetDeleteFlags should have comment or be unexported (golint)
    • Line 26: warning: exported function DeleteApp should have comment or be unexported (golint)
    • Line 56: warning: comment on exported function NewDeleteCommands should be of the form "NewDeleteCommands ..." (golint)
    • sealos/k8s/node.go
    • Line 20: warning: exported const HostnameLabel should have comment (or a comment on this block) or be unexported (golint)
    • Line 28: warning: exported var KubeDefaultConfigPath should have comment or be unexported (golint)
    • sealos/install/download.go
    • Line 14: warning: comment on exported function SendPackage should be of the form "SendPackage ..." (golint)
    • Line 65: warning: exported function DownloadFile should have comment or be unexported (golint)
    • sealos/k8s/drain.go
    • Line 16: warning: exported const EvictionKind should have comment (or a comment on this block) or be unexported (golint)
    • Line 20: warning: exported function EvictNodePods should have comment or be unexported (golint)
    • Line 36: warning: exported function EvictPod should have comment or be unexported (golint)
    • Line 52: warning: exported function CordonUnCordon should have comment or be unexported (golint)
    • sealos/cmd/etcd.go
    • Line 1: warning: package comment should be of the form "Package cmd ..." (golint)
    • Line 59: warning: exported function NewEtcdCommand should have comment or be unexported (golint)
    • Line 79: warning: exported function NewEtcdSaveCommand should have comment or be unexported (golint)
    • Line 97: warning: exported function NewEtcdRestoreCommand should have comment or be unexported (golint)
    • Line 110: warning: exported function NewEtcdHealthCommand should have comment or be unexported (golint)
    • Line 118: warning: exported function EtcdSaveCmdFunc should have comment or be unexported (golint)
    • Line 128: warning: exported function EtcdRestoreCmdFunc should have comment or be unexported (golint)
    • Line 163: warning: exported function EtcdHealthCmdFunc should have comment or be unexported (golint)
    • sealos/install/config.go
    • Line 98: warning: exported function Dump should have comment or be unexported (golint)
    • Line 166: warning: exported function Load should have comment or be unexported (golint)
    • Line 180: warning: exported method SealConfig.ShowDefaultConfig should have comment or be unexported (golint)
    • sealos/cert/cert.go
    • Line 146: warning: comment on exported function NewCaCertAndKeyFromRoot should be of the form "NewCaCertAndKeyFromRoot ..." (golint)
    • Line 202: warning: comment on exported function WriteCertAndKey should be of the form "WriteCertAndKey ..." (golint)
    • sealos/install/etcd_save.go
    • Line 22: warning: exported type EtcdFlags should have comment or be unexported (golint)
    • Line 32: warning: exported function GetEtcdBackFlags should have comment or be unexported (golint)
    • Line 79: warning: exported method EtcdFlags.Save should have comment or be unexported (golint)
    • Line 140: warning: exported type AliOss should have comment or be unexported (golint)
    • Line 162: warning: exported function GetCfg should have comment or be unexported (golint)
    • Line 183: warning: exported function GetEtcdClient should have comment or be unexported (golint)
    • Line 211: warning: exported function GetHealthFlag should have comment or be unexported (golint)
    • Line 232: warning: exported method EtcdFlags.HealthCheck should have comment or be unexported (golint)
    • sealos/install/vars.go
    • Line 15: warning: exported var MasterIPs should have comment or be unexported (golint)
    • Line 18: warning: comment on exported var DnsDomain should be of the form "DnsDomain ..." (golint)
    • Line 21: warning: comment on exported var SSHConfig should be of the form "SSHConfig ..." (golint)
    • Line 24: warning: comment on exported var CertPath should be of the form "CertPath ..." (golint)
    • Line 31: warning: comment on exported var CriSocket should be of the form "CriSocket ..." (golint)
    • Line 46: warning: comment on exported var Ipvs should be of the form "Ipvs ..." (golint)
    • Line 50: warning: comment on exported var Network should be of the form "Network ..." (golint)
    • Line 52: warning: comment on exported var WithoutCNI should be of the form "WithoutCNI ..." (golint)
    • Line 54: warning: comment on exported var Interface should be of the form "Interface ..." (golint)
    • Line 56: warning: comment on exported var IPIP should be of the form "IPIP ..." (golint)
    • Line 58: warning: comment on exported var MTU should be of the form "MTU ..." (golint)
    • Line 68: warning: comment on exported var InDocker should be of the form "InDocker ..." (golint)
    • Line 74: warning: comment on exported var OssEndpoint should be of the form "OssEndpoint ..." (golint)
    • sealos/pkg/sshcmd/sshutil/scp.go
    • Line 20: warning: comment on exported method SSH.CopyForMD5 should be of the form "CopyForMD5 ..." (golint)
    • Line 41: warning: exported method SSH.Md5Sum should have comment or be unexported (golint)
    • Line 105: warning: comment on exported method SSH.CopyConfigFile should be of the form "CopyConfigFile ..." (golint)
    • Line 384: warning: exported method SSH.ValidateMd5sumLocalWithRemote should have comment or be unexported (golint)
    • sealos/cert/kube_certs.go
    • Line 15: warning: exported var SealosConfigDir should have comment or be unexported (golint)
    • Line 21: warning: exported function GetUserHomeDir should have comment or be unexported (golint)
    • Line 30: warning: exported function CaList should have comment or be unexported (golint)
    • Line 65: warning: exported function CertList should have comment or be unexported (golint)
    • Line 157: warning: comment on exported type SealosCertMetaData should be of the form "SealosCertMetaData ..." (with optional leading article) (golint)
    • Line 169: warning: exported const APIserverCert should have comment (or a comment on this block) or be unexported (golint)
    • Line 178: warning: comment on exported function NewSealosCertMetaData should be of the form "NewSealosCertMetaData ..." (golint)
    • Line 269: warning: exported method SealosCertMetaData.GenerateAll should have comment or be unexported (golint)
    • sealos/install/constants.go
    • Line 4: warning: exported const ErrorExitOSCase should have comment (or a comment on this block) or be unexported (golint)
    • Line 16: warning: comment on exported const ETCDSNAPSHOTDEFAULTNAME should be of the form "ETCDSNAPSHOTDEFAULTNAME ..." (golint)
    • Line 23: warning: comment on exported const KUBECONTROLLERCONFIGFILE should be of the form "KUBECONTROLLERCONFIGFILE ..." (golint)
    • Line 27: warning: comment on exported const DefaultDockerCRISocket should be of the form "DefaultDockerCRISocket ..." (golint)
    • Line 32: warning: exported const InitTemplateTextV1beta1 should have comment or be unexported (golint)
    • Line 96: warning: exported const JoinCPTemplateTextV1beta2 should have comment or be unexported (golint)
    • Line 119: warning: exported const InitTemplateTextV1bate2 should have comment or be unexported (golint)
    • sealos/install/generator.go
    • Line 12: warning: exported var ConfigType should have comment or be unexported (golint)
    • Line 14: warning: exported function Config should have comment or be unexported (golint)
    • Line 61: warning: exported function JoinTemplateFromTemplateContent should have comment or be unexported (golint)
    • Line 88: warning: exported function TemplateFromTemplateContent should have comment or be unexported (golint)
    • Line 119: warning: comment on exported function KubeadmDataFromYaml should be of the form "KubeadmDataFromYaml ..." (golint)
    • Line 144: warning: exported type KubeadmType should have comment or be unexported (golint)
    • sealos/install/upgrade.go
    • Line 14: warning: exported type SealosUpgrade should have comment or be unexported (golint)
    • Line 26: warning: exported function NewUpgrade should have comment or be unexported (golint)
    • Line 41: warning: exported function ExitUpgradeCase should have comment or be unexported (golint)
    • Line 60: warning: exported method SealosUpgrade.SetUP should have comment or be unexported (golint)
    • Line 164: warning: exported method SealosUpgrade.SetIPtoHostName should have comment or be unexported (golint)
    • Line 173: warning: exported method SealosUpgrade.GetHostNamesFromIps should have comment or be unexported (golint)
    • Line 186: warning: exported method SealosUpgrade.GetIpByHostname should have comment or be unexported (golint)
    • sealos/install/join.go
    • Line 62: warning: comment on exported method SealosInstaller.GeneratorCerts should be of the form "GeneratorCerts ..." (golint)
    • sealos/ipvs/lvscare.go
    • Line 15: warning: exported type LvscareImage should have comment or be unexported (golint)
    • Line 24: warning: comment on exported function LvsStaticPodYaml should be of the form "LvsStaticPodYaml ..." (golint)
    • sealos/net/flannel.go
    • Line 3: warning: exported type Flannel should have comment or be unexported (golint)
    • Line 7: warning: exported method Flannel.Manifests should have comment or be unexported (golint)
    • Line 25: warning: exported method Flannel.Template should have comment or be unexported (golint)
    • Line 29: warning: comment on exported const FlannelManifests should be of the form "FlannelManifests ..." (golint)
    • sealos/cert/kubeconfig.go
    • Line 58: warning: comment on exported function CreateKubeConfigFile should be of the form "CreateKubeConfigFile ..." (golint)
    • Line 372: warning: comment on exported function CreateBasic should be of the form "CreateBasic ..." (golint)
    • Line 396: warning: comment on exported function CreateWithToken should be of the form "CreateWithToken ..." (golint)
    • Line 406: warning: comment on exported function CreateWithCerts should be of the form "CreateWithCerts ..." (golint)
    • sealos/install/exec.go
    • Line 12: warning: exported type ExecFlag should have comment or be unexported (golint)
    • Line 22: warning: exported var Dst should have comment or be unexported (golint)
    • Line 29: warning: exported function GetExecFlag should have comment or be unexported (golint)
    • sealos/install/init.go
    • Line 126: warning: exported method SealosInstaller.GenerateCert should have comment or be unexported (golint)
    • Line 136: warning: exported method SealosInstaller.CreateKubeconfig should have comment or be unexported (golint)
    • Line 207: warning: comment on exported method SealosInstaller.SendKubeConfigs should be of the form "SendKubeConfigs ..." (golint)
    • Line 219: warning: exported method SealosInstaller.SendJoinMasterKubeConfigs should have comment or be unexported (golint)
    • sealos/install/route.go
    • Line 13: warning: exported type RouteFlags should have comment or be unexported (golint)
    • Line 18: warning: exported function GetRouteFlag should have comment or be unexported (golint)
    • Line 34: warning: exported method RouteFlags.CheckRoute should have comment or be unexported (golint)
    • Line 39: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 45: warning: exported method RouteFlags.SetRoute should have comment or be unexported (golint)
    • Line 54: warning: exported method RouteFlags.DelRoute should have comment or be unexported (golint)
    • sealos/pkg/appmanager/installapp.go
    • Line 13: warning: exported type InstallFlags should have comment or be unexported (golint)
    • Line 21: warning: exported function GetInstallFlags should have comment or be unexported (golint)
    • Line 30: warning: exported function InstallApp should have comment or be unexported (golint)
    • Line 62: warning: comment on exported function NewInstallCommands should be of the form "NewInstallCommands ..." (golint)
    • sealos/install/etcd_restore.go
    • Line 23: warning: exported function RandStringRunes should have comment or be unexported (golint)
    • Line 31: warning: exported function GetRestoreFlags should have comment or be unexported (golint)
    • Line 129: warning: exported method EtcdFlags.AfterRestore should have comment or be unexported (golint)
    • Line 154: warning: comment on exported method EtcdFlags.StartPod should be of the form "StartPod ..." (golint)
    • Line 191: warning: exported function GetEtcdInitialCluster should have comment or be unexported (golint)
    • Line 205: warning: exported function GetEtcdPeerURLs should have comment or be unexported (golint)
    • Line 213: warning: exported function CmdWork should have comment or be unexported (golint)
    • sealos/cmd/route.go
    • Line 1: warning: package comment should be of the form "Package cmd ..." (golint)
    • Line 29: warning: exported function NewRouteCmd should have comment or be unexported (golint)
    • Line 47: warning: exported function NewAddRouteCmd should have comment or be unexported (golint)
    • Line 59: warning: exported function NewDelRouteCmd should have comment or be unexported (golint)
    • Line 71: warning: exported function RouteCmdFunc should have comment or be unexported (golint)
    • Line 76: warning: exported function RouteAddCmdFunc should have comment or be unexported (golint)
    • Line 81: warning: exported function RouteDelCmdFunc should have comment or be unexported (golint)
    • sealos/pkg/sshcmd/cmd/watch.go
    • Line 15: warning: comment on exported function LoggerFileSize should be of the form "LoggerFileSize ..." (golint)
    • Line 36: warning: comment on exported function IsFileExist should be of the form "IsFileExist ..." (golint)
    • sealos/install/cloud.go
    • Line 46: warning: comment on exported var C should be of the form "C ..." (golint)
    • Line 48: warning: exported var ClusterDir should have comment or be unexported (golint)
    • Line 50: warning: comment on exported function CloudInstall should be of the form "CloudInstall ..." (golint)
    • sealos/install/sealos.go
    • Line 10: warning: exported type CleanCluster should have comment or be unexported (golint)
    • Line 15: warning: exported type JoinNodeAndMaster should have comment or be unexported (golint)
    • Line 21: warning: exported type Init should have comment or be unexported (golint)
    • Line 29: warning: exported type Install should have comment or be unexported (golint)
    • Line 36: warning: exported var JoinToken should have comment or be unexported (golint)
    • Line 50: warning: exported type CommandType should have comment or be unexported (golint)
    • Line 52: warning: comment on exported const InitMaster should be of the form "InitMaster ..." (golint)
    • Line 54: warning: exported const JoinMaster should have comment or be unexported (golint)
    • Line 55: warning: exported const JoinNode should have comment or be unexported (golint)
    • Line 57: warning: exported method SealosInstaller.Command should have comment or be unexported (golint)
    • sealos/net/net.go
    • Line 9: warning: exported const CALICO should have comment (or a comment on this block) or be unexported (golint)
    • Line 18: warning: exported type MetaData should have comment or be unexported (golint)
    • Line 38: warning: exported function NewNetwork should have comment or be unexported (golint)
    • sealos/pkg/appmanager/appmanager.go
    • Line 23: warning: exported type PkgConfig should have comment or be unexported (golint)
    • Line 42: warning: exported function LoadAppConfig should have comment or be unexported (golint)
    • Line 137: warning: exported type Runner should have comment or be unexported (golint)
    • Line 143: warning: exported type RunOnEveryNodes should have comment or be unexported (golint)
    • Line 147: warning: exported method RunOnEveryNodes.CleanUp should have comment or be unexported (golint)
    • Line 165: warning: exported method RunOnEveryNodes.Send should have comment or be unexported (golint)
    • Line 179: warning: exported method RunOnEveryNodes.Run should have comment or be unexported (golint)
    • Line 196: warning: exported type RunOnMaster should have comment or be unexported (golint)
    • Line 212: warning: comment on exported method RunOnMaster.Send should be of the form "Send ..." (golint)
    • Line 223: warning: exported method RunOnMaster.Run should have comment or be unexported (golint)
    • Line 231: warning: exported method RunOnMaster.CleanUp should have comment or be unexported (golint)
    • Line 237: warning: exported function CmdWorkSpace should have comment or be unexported (golint)
    • Line 242: warning: exported function CmdFileExist should have comment or be unexported (golint)
    • sealos/cmd/exec.go
    • Line 1: warning: package comment should be of the form "Package cmd ..." (golint)
    • Line 53: warning: exported function ExecCmdFunc should have comment or be unexported (golint)
    • sealos/pkg/sshcmd/sshutil/watch.go
    • Line 16: warning: comment on exported method SSH.LoggerFileSize should be of the form "LoggerFileSize ..." (golint)
    • Line 37: warning: comment on exported method SSH.IsFileExist should be of the form "IsFileExist ..." (golint)
    • Line 65: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • sealos/install/utils.go
    • Line 27: warning: comment on exported function ExitInitCase should be of the form "ExitInitCase ..." (golint)
    • Line 50: warning: exported function ExitDeleteCase should have comment or be unexported (golint)
    • Line 58: warning: exported function ExitInstallCase should have comment or be unexported (golint)
    • Line 118: warning: exported function FileExist should have comment or be unexported (golint)
    • Line 213: warning: exported function DecodeIPs should have comment or be unexported (golint)
    • Line 238: warning: comment on exported function GetConfirmResult should be of the form "GetConfirmResult ..." (golint)
    • Line 243: warning: comment on exported function Confirm should be of the form "Confirm ..." (golint)
    • Line 264: warning: exported function SliceRemoveStr should have comment or be unexported (golint)
    • Line 295: warning: exported function GetRemoteHostName should have comment or be unexported (golint)
    • Line 300: warning: comment on exported function FetchSealosAbsPath should be of the form "FetchSealosAbsPath ..." (golint)
    • Line 307: warning: exported function CompressTar should have comment or be unexported (golint)
    • Line 445: warning: comment on exported function GetMajorMinorInt should be of the form "GetMajorMinorInt ..." (golint)
    • Line 466: warning: exported function CanUpgradeByNewVersion should have comment or be unexported (golint)
    • Line 493: warning: exported function For120 should have comment or be unexported (golint)
    • Line 499: warning: if block ends with a return statement, so drop this else and outdent its block (golint)

gocyclo100%

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!


ineffassign95%

IneffAssign detects ineffectual assignments in Go code.


license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


misspell97%

Misspell Finds commonly misspelled English words