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:
@@ -344,7 +344,7 @@ func stringBody(body string) io.ReadCloser {
|
||||
// }
|
||||
//}
|
||||
|
||||
func ExamplePrintReplicationControllerWithNamespace() {
|
||||
func Example_printReplicationControllerWithNamespace() {
|
||||
f, tf, codec := NewAPIFactory()
|
||||
tf.Printer = kubectl.NewHumanReadablePrinter(false, true, false, false, false, false, []string{})
|
||||
tf.Client = &fake.RESTClient{
|
||||
@@ -390,7 +390,7 @@ func ExamplePrintReplicationControllerWithNamespace() {
|
||||
// beep foo 1 1 10y
|
||||
}
|
||||
|
||||
func ExamplePrintMultiContainersReplicationControllerWithWide() {
|
||||
func Example_printMultiContainersReplicationControllerWithWide() {
|
||||
f, tf, codec := NewAPIFactory()
|
||||
tf.Printer = kubectl.NewHumanReadablePrinter(false, false, true, false, false, false, []string{})
|
||||
tf.Client = &fake.RESTClient{
|
||||
@@ -439,7 +439,7 @@ func ExamplePrintMultiContainersReplicationControllerWithWide() {
|
||||
// foo 1 1 10y foo,foo2 someimage,someimage2 foo=bar
|
||||
}
|
||||
|
||||
func ExamplePrintReplicationController() {
|
||||
func Example_printReplicationController() {
|
||||
f, tf, codec := NewAPIFactory()
|
||||
tf.Printer = kubectl.NewHumanReadablePrinter(false, false, false, false, false, false, []string{})
|
||||
tf.Client = &fake.RESTClient{
|
||||
@@ -488,7 +488,7 @@ func ExamplePrintReplicationController() {
|
||||
// foo 1 1 10y
|
||||
}
|
||||
|
||||
func ExamplePrintPodWithWideFormat() {
|
||||
func Example_printPodWithWideFormat() {
|
||||
f, tf, codec := NewAPIFactory()
|
||||
tf.Printer = kubectl.NewHumanReadablePrinter(false, false, true, false, false, false, []string{})
|
||||
tf.Client = &fake.RESTClient{
|
||||
@@ -524,7 +524,7 @@ func ExamplePrintPodWithWideFormat() {
|
||||
// test1 1/2 podPhase 6 10y kubernetes-minion-abcd
|
||||
}
|
||||
|
||||
func ExamplePrintPodWithShowLabels() {
|
||||
func Example_printPodWithShowLabels() {
|
||||
f, tf, codec := NewAPIFactory()
|
||||
tf.Printer = kubectl.NewHumanReadablePrinter(false, false, false, false, true, false, []string{})
|
||||
tf.Client = &fake.RESTClient{
|
||||
@@ -656,7 +656,7 @@ func newAllPhasePodList() *api.PodList {
|
||||
}
|
||||
}
|
||||
|
||||
func ExamplePrintPodHideTerminated() {
|
||||
func Example_printPodHideTerminated() {
|
||||
f, tf, codec := NewAPIFactory()
|
||||
tf.Printer = kubectl.NewHumanReadablePrinter(false, false, false, false, false, false, []string{})
|
||||
tf.Client = &fake.RESTClient{
|
||||
@@ -677,7 +677,7 @@ func ExamplePrintPodHideTerminated() {
|
||||
// test5 1/2 Unknown 6 10y
|
||||
}
|
||||
|
||||
func ExamplePrintPodShowAll() {
|
||||
func Example_printPodShowAll() {
|
||||
f, tf, codec := NewAPIFactory()
|
||||
tf.Printer = kubectl.NewHumanReadablePrinter(false, false, false, true, false, false, []string{})
|
||||
tf.Client = &fake.RESTClient{
|
||||
@@ -700,7 +700,7 @@ func ExamplePrintPodShowAll() {
|
||||
// test5 1/2 Unknown 6 10y
|
||||
}
|
||||
|
||||
func ExamplePrintServiceWithNamespacesAndLabels() {
|
||||
func Example_printServiceWithNamespacesAndLabels() {
|
||||
f, tf, codec := NewAPIFactory()
|
||||
tf.Printer = kubectl.NewHumanReadablePrinter(false, true, false, false, false, false, []string{"l1"})
|
||||
tf.Client = &fake.RESTClient{
|
||||
|
@@ -44,7 +44,7 @@ func newRedFederalCowHammerConfig() clientcmdapi.Config {
|
||||
}
|
||||
}
|
||||
|
||||
func ExampleView() {
|
||||
func Example_view() {
|
||||
expectedConfig := newRedFederalCowHammerConfig()
|
||||
test := configCommandTest{
|
||||
args: []string{"view"},
|
||||
|
@@ -415,14 +415,14 @@ func NewFactory(optionalClientConfig clientcmd.ClientConfig) *Factory {
|
||||
// TODO(madhusudancs): Make this smarter by admitting MatchExpressions with Equals
|
||||
// operator, DoubleEquals operator and In operator with only one element in the set.
|
||||
if len(t.Spec.Selector.MatchExpressions) > 0 {
|
||||
return "", fmt.Errorf("couldn't convert expressions - \"%+v\" to map-based selector format")
|
||||
return "", fmt.Errorf("couldn't convert expressions - \"%+v\" to map-based selector format", t.Spec.Selector.MatchExpressions)
|
||||
}
|
||||
return kubectl.MakeLabels(t.Spec.Selector.MatchLabels), nil
|
||||
case *extensions.ReplicaSet:
|
||||
// TODO(madhusudancs): Make this smarter by admitting MatchExpressions with Equals
|
||||
// operator, DoubleEquals operator and In operator with only one element in the set.
|
||||
if len(t.Spec.Selector.MatchExpressions) > 0 {
|
||||
return "", fmt.Errorf("couldn't convert expressions - \"%+v\" to map-based selector format")
|
||||
return "", fmt.Errorf("couldn't convert expressions - \"%+v\" to map-based selector format", t.Spec.Selector.MatchExpressions)
|
||||
}
|
||||
return kubectl.MakeLabels(t.Spec.Selector.MatchLabels), nil
|
||||
default:
|
||||
|
Reference in New Issue
Block a user