提交 96c39bf0 编写于 作者: A Anders F Björklund

Pick some lint from the recent master commits

上级 76a8df22
......@@ -249,6 +249,8 @@ endif
which go-bindata || GO111MODULE=off GOBIN="$(GOPATH)$(DIRSEP)bin" go get github.com/jteeuwen/go-bindata/...
PATH="$(PATH)$(PATHSEP)$(GOPATH)$(DIRSEP)bin" go-bindata -nomemcopy -o $@ -pkg assets deploy/addons/...
-gofmt -s -w $@
@#golint: Dns should be DNS (compat sed)
@sed -i -e 's/Dns/DNS/g' $@ && rm -f ./-e
pkg/minikube/translate/translations.go: $(shell find "translations/" -type f)
ifeq ($(MINIKUBE_BUILD_IN_DOCKER),y)
......@@ -308,7 +310,7 @@ vet:
@go vet $(SOURCE_PACKAGES)
.PHONY: golint
golint:
golint: pkg/minikube/assets/assets.go pkg/minikube/translate/translations.go
@golint -set_exit_status $(SOURCE_PACKAGES)
.PHONY: gocyclo
......
......@@ -56,11 +56,15 @@ associated files.`,
type typeOfError int
const (
Fatal typeOfError = 0
// Fatal is a type of DeletionError
Fatal typeOfError = 0
// MissingProfile is a type of DeletionError
MissingProfile typeOfError = 1
// MissingCluster is a type of DeletionError
MissingCluster typeOfError = 2
)
// DeletionError can be returned from DeleteProfiles
type DeletionError struct {
Err error
Errtype typeOfError
......@@ -118,7 +122,7 @@ func runDelete(cmd *cobra.Command, args []string) {
}
}
// Deletes one or more profiles
// DeleteProfiles deletes one or more profiles
func DeleteProfiles(profiles []*pkg_config.Profile) []error {
var errs []error
for _, profile := range profiles {
......@@ -246,7 +250,7 @@ func uninstallKubernetes(api libmachine.API, kc pkg_config.KubernetesConfig, bsN
return nil
}
// Handles deletion error from DeleteProfiles
// HandleDeletionErrors handles deletion errors from DeleteProfiles
func HandleDeletionErrors(errors []error) {
if len(errors) == 1 {
handleSingleDeletionError(errors[0])
......
......@@ -137,6 +137,7 @@ type kubectlversion struct {
SVersion VersionInfo `json:"serverVersion"`
}
// VersionInfo holds version information
type VersionInfo struct {
Major string `json:"major"`
Minor string `json:"minor"`
......
......@@ -26,7 +26,9 @@ import (
)
const (
DefaultImageRepo = "k8s.gcr.io"
// DefaultImageRepo is the default repository for images
DefaultImageRepo = "k8s.gcr.io"
// DefaultMinikubeRepo is the default repository for minikube
DefaultMinikubeRepo = "gcr.io/k8s-minikube"
)
......
......@@ -604,8 +604,8 @@ func CreateSSHShell(api libmachine.API, args []string) error {
return client.Shell(args...)
}
// EnsureMinikubeRunningOrExit checks that minikube has a status available and that
// the status is `Running`, otherwise it will exit
// IsMinikubeRunning checks that minikube has a status available and that
// the status is `Running`
func IsMinikubeRunning(api libmachine.API) bool {
s, err := GetHostStatus(api)
if err != nil {
......
......@@ -26,6 +26,7 @@ import (
"k8s.io/minikube/pkg/minikube/machine"
)
// Machine contains information about a machine
type Machine struct {
*host.Host
}
......@@ -58,7 +59,7 @@ func (h *Machine) IsValid() bool {
return true
}
// ListsMachines return all valid and invalid machines
// ListMachines return all valid and invalid machines
// If a machine is valid or invalid is determined by the cluster.IsValid function
func ListMachines(miniHome ...string) (validMachines []*Machine, inValidMachines []*Machine, err error) {
pDirs, err := machineDirs(miniHome...)
......@@ -80,7 +81,7 @@ func ListMachines(miniHome ...string) (validMachines []*Machine, inValidMachines
return validMachines, inValidMachines, nil
}
// Loads a machine or throws an error if the machine could not be loadedG
// LoadMachine loads a machine or throws an error if the machine could not be loadedG
func LoadMachine(name string) (*Machine, error) {
api, err := machine.NewAPIClient()
if err != nil {
......
......@@ -136,7 +136,7 @@ func ListProfiles(miniHome ...string) (validPs []*Profile, inValidPs []*Profile,
return validPs, inValidPs, nil
}
// loadProfile loads type Profile based on its name
// LoadProfile loads type Profile based on its name
func LoadProfile(name string, miniHome ...string) (*Profile, error) {
cfg, err := DefaultLoader.LoadConfigFromFile(name, miniHome...)
p := &Profile{
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册