From 764ae69671428987d77898b2d3c48c6c003e2fd4 Mon Sep 17 00:00:00 2001 From: Nikhita Raghunath Date: Sun, 24 Jun 2018 21:04:07 +0530 Subject: [PATCH] client-go/examples/fake-client: add doc.go to fix go build warnings The fakeclient package does not have any non-test go files. This causes `go build` to give a warning: `no non-test Go files in ...`. This also causes the publishing bot to fail. This PR adds a dummy doc.go file in the package to avoid this warning. --- .../client-go/examples/fake-client/BUILD | 11 +++++++++- .../client-go/examples/fake-client/doc.go | 20 +++++++++++++++++++ 2 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 staging/src/k8s.io/client-go/examples/fake-client/doc.go diff --git a/staging/src/k8s.io/client-go/examples/fake-client/BUILD b/staging/src/k8s.io/client-go/examples/fake-client/BUILD index 62819fdf912..8e633789b06 100644 --- a/staging/src/k8s.io/client-go/examples/fake-client/BUILD +++ b/staging/src/k8s.io/client-go/examples/fake-client/BUILD @@ -1,8 +1,9 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_test") +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") go_test( name = "go_default_test", srcs = ["main_test.go"], + embed = [":go_default_library"], deps = [ "//staging/src/k8s.io/api/core/v1:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", @@ -25,3 +26,11 @@ filegroup( tags = ["automanaged"], visibility = ["//visibility:public"], ) + +go_library( + name = "go_default_library", + srcs = ["doc.go"], + importmap = "k8s.io/kubernetes/vendor/k8s.io/client-go/examples/fake-client", + importpath = "k8s.io/client-go/examples/fake-client", + visibility = ["//visibility:public"], +) diff --git a/staging/src/k8s.io/client-go/examples/fake-client/doc.go b/staging/src/k8s.io/client-go/examples/fake-client/doc.go new file mode 100644 index 00000000000..1c02e5ea5e7 --- /dev/null +++ b/staging/src/k8s.io/client-go/examples/fake-client/doc.go @@ -0,0 +1,20 @@ +/* +Copyright 2018 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Package fakeclient contains examples on how to use fakeclient in tests. +// Note: This file is here to avoid warnings on go build since there are no +// non-test files in this package. +package fakeclient