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

@@ -24,9 +24,9 @@ import (
)
type encodable struct {
e Encoder `json:"-"`
E Encoder `json:"-"`
obj Object
versions []unversioned.GroupVersion `json:"-"`
versions []unversioned.GroupVersion
}
func (e encodable) GetObjectKind() unversioned.ObjectKind { return e.obj.GetObjectKind() }
@@ -47,7 +47,7 @@ func (re encodable) UnmarshalJSON(in []byte) error {
// Marshal may get called on pointers or values, so implement MarshalJSON on value.
// http://stackoverflow.com/questions/21390979/custom-marshaljson-never-gets-called-in-go
func (re encodable) MarshalJSON() ([]byte, error) {
return Encode(re.e, re.obj)
return Encode(re.E, re.obj)
}
// NewEncodableList creates an object that will be encoded with the provided codec on demand.