Merge pull request #23660 from goltermann/vetclean

Automatic merge from submit-queue

Additional go vet fixes

Mostly:
- pass lock by value
- bad syntax for struct tag value
- example functions not formatted properly
This commit is contained in:
k8s-merge-robot
2016-04-12 06:22:16 -07:00
33 changed files with 136 additions and 118 deletions

View File

@@ -206,7 +206,7 @@ func TestFlattenSuccess(t *testing.T) {
}
func ExampleMinifyAndShorten() {
func Example_minifyAndShorten() {
certFile, _ := ioutil.TempFile("", "")
defer os.Remove(certFile.Name())
keyFile, _ := ioutil.TempFile("", "")

View File

@@ -22,7 +22,7 @@ import (
"github.com/ghodss/yaml"
)
func ExampleEmptyConfig() {
func Example_emptyConfig() {
defaultConfig := NewConfig()
output, err := yaml.Marshal(defaultConfig)
@@ -39,7 +39,7 @@ func ExampleEmptyConfig() {
// users: {}
}
func ExampleOfOptionsConfig() {
func Example_ofOptionsConfig() {
defaultConfig := NewConfig()
defaultConfig.Preferences.Colors = true
defaultConfig.Clusters["alfa"] = &Cluster{

View File

@@ -376,7 +376,7 @@ func TestMigratingFileSourceMissingSkip(t *testing.T) {
}
}
func ExampleNoMergingOnExplicitPaths() {
func Example_noMergingOnExplicitPaths() {
commandLineFile, _ := ioutil.TempFile("", "")
defer os.Remove(commandLineFile.Name())
envVarFile, _ := ioutil.TempFile("", "")
@@ -423,7 +423,7 @@ func ExampleNoMergingOnExplicitPaths() {
// token: red-token
}
func ExampleMergingSomeWithConflict() {
func Example_mergingSomeWithConflict() {
commandLineFile, _ := ioutil.TempFile("", "")
defer os.Remove(commandLineFile.Name())
envVarFile, _ := ioutil.TempFile("", "")
@@ -476,7 +476,7 @@ func ExampleMergingSomeWithConflict() {
// token: yellow-token
}
func ExampleMergingEverythingNoConflicts() {
func Example_mergingEverythingNoConflicts() {
commandLineFile, _ := ioutil.TempFile("", "")
defer os.Remove(commandLineFile.Name())
envVarFile, _ := ioutil.TempFile("", "")

View File

@@ -97,8 +97,6 @@ func ObjectReaction(o ObjectRetriever, mapper meta.RESTMapper) ReactionFunc {
default:
return false, nil, fmt.Errorf("no reaction implemented for %s", action)
}
return true, nil, nil
}
}