Skip to content

Commit

Permalink
golang format tools (#497)
Browse files Browse the repository at this point in the history
Produced via:
  `gofmt -s -w $(find -path './vendor' -prune -o -type f -name '*.go' -print))`
  `goimports -w $(find -name '*.go' | grep -v vendor)`
/assign @mattmoor
  • Loading branch information
mattmoor-sockpuppet authored and knative-prow-robot committed Jun 27, 2019
1 parent 80192ab commit 1864f49
Show file tree
Hide file tree
Showing 35 changed files with 43 additions and 43 deletions.
2 changes: 1 addition & 1 deletion apis/duck/v1alpha1/condition_set.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ import (

"fmt"

"knative.dev/pkg/apis"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"knative.dev/pkg/apis"
)

// Conditions is the interface for a Resource that implements the getter and
Expand Down
2 changes: 1 addition & 1 deletion apis/duck/v1alpha1/condition_set_impl_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ import (

"github.com/google/go-cmp/cmp"
"github.com/google/go-cmp/cmp/cmpopts"
"knative.dev/pkg/apis"
corev1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/api/equality"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"knative.dev/pkg/apis"
)

// TestStatus is to validate ConditionAccessor interface works
Expand Down
2 changes: 1 addition & 1 deletion apis/duck/v1alpha1/condition_type_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ import (
"time"

"github.com/google/go-cmp/cmp"
"knative.dev/pkg/apis"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"knative.dev/pkg/apis"
)

func TestIsTrue(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion apis/duck/v1alpha1/register.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ limitations under the License.
package v1alpha1

import (
"knative.dev/pkg/apis/duck"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/runtime/schema"
"knative.dev/pkg/apis/duck"
)

// SchemeGroupVersion is group version used to register these objects
Expand Down
2 changes: 1 addition & 1 deletion apis/duck/v1beta1/register.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ limitations under the License.
package v1beta1

import (
"knative.dev/pkg/apis/duck"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/runtime/schema"
"knative.dev/pkg/apis/duck"
)

// SchemeGroupVersion is group version used to register these objects
Expand Down
2 changes: 1 addition & 1 deletion apis/duck/v1beta1/status_types_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ import (
"testing"

"github.com/google/go-cmp/cmp"
"knative.dev/pkg/apis"
corev1 "k8s.io/api/core/v1"
"knative.dev/pkg/apis"
)

func TestStatusGetCondition(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion apis/istio/authentication/v1alpha1/policy_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ limitations under the License.
package v1alpha1

import (
"knative.dev/pkg/apis/istio/common/v1alpha1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"knative.dev/pkg/apis/istio/common/v1alpha1"
)

// +genclient
Expand Down
2 changes: 1 addition & 1 deletion apis/istio/authentication/v1alpha1/register.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ limitations under the License.
package v1alpha1

import (
"knative.dev/pkg/apis/istio/authentication"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/runtime/schema"
"knative.dev/pkg/apis/istio/authentication"
)

// SchemeGroupVersion is group version used to register these objects
Expand Down
2 changes: 1 addition & 1 deletion apis/istio/v1alpha3/register.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ limitations under the License.
package v1alpha3

import (
"knative.dev/pkg/apis/istio"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/runtime/schema"
"knative.dev/pkg/apis/istio"
)

// SchemeGroupVersion is group version used to register these objects
Expand Down
2 changes: 1 addition & 1 deletion apis/istio/v1alpha3/virtualservice_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ limitations under the License.
package v1alpha3

import (
"knative.dev/pkg/apis/istio/common/v1alpha1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"knative.dev/pkg/apis/istio/common/v1alpha1"
)

// +genclient
Expand Down
2 changes: 1 addition & 1 deletion apis/testing/conditions.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ import (
"fmt"
"testing"

corev1 "k8s.io/api/core/v1"
"knative.dev/pkg/apis"
duckv1b1 "knative.dev/pkg/apis/duck/v1beta1"
corev1 "k8s.io/api/core/v1"
)

// CheckCondition checks if condition `c` on `cc` has value `cs`.
Expand Down
2 changes: 1 addition & 1 deletion cloudevents/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ import (

"github.com/google/go-cmp/cmp"
"github.com/google/go-cmp/cmp/cmpopts"
"knative.dev/pkg/cloudevents"
"k8s.io/apimachinery/pkg/util/sets"
"knative.dev/pkg/cloudevents"
)

var (
Expand Down
2 changes: 1 addition & 1 deletion codegen/cmd/injection-gen/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ import (
"k8s.io/gengo/args"
"k8s.io/klog"

"github.com/spf13/pflag"
generatorargs "knative.dev/pkg/codegen/cmd/injection-gen/args"
"knative.dev/pkg/codegen/cmd/injection-gen/generators"
"github.com/spf13/pflag"
)

func main() {
Expand Down
2 changes: 1 addition & 1 deletion configmap/testing/configmap.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ import (
"testing"

"github.com/ghodss/yaml"
"knative.dev/pkg/configmap"
corev1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/util/sets"
"knative.dev/pkg/configmap"
)

// ConfigMapFromTestFile creates a v1.ConfigMap from a YAML file
Expand Down
2 changes: 1 addition & 1 deletion controller/stats_reporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ import (
"errors"
"time"

"knative.dev/pkg/metrics"
"go.opencensus.io/stats"
"go.opencensus.io/stats/view"
"go.opencensus.io/tag"
"go.uber.org/zap"
"knative.dev/pkg/metrics"
)

var (
Expand Down
2 changes: 1 addition & 1 deletion injection/sharedmain/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import (
"k8s.io/client-go/rest"
"k8s.io/client-go/tools/clientcmd"

"go.uber.org/zap"
"knative.dev/pkg/configmap"
"knative.dev/pkg/controller"
"knative.dev/pkg/injection"
Expand All @@ -32,7 +33,6 @@ import (
"knative.dev/pkg/metrics"
"knative.dev/pkg/signals"
"knative.dev/pkg/system"
"go.uber.org/zap"
)

func Main(component string, ctors ...injection.ControllerConstructor) {
Expand Down
2 changes: 1 addition & 1 deletion metrics/record.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ import (
"context"
"path"

"knative.dev/pkg/metrics/metricskey"
"go.opencensus.io/stats"
"knative.dev/pkg/metrics/metricskey"
)

// Record decides whether to record one measurement via OpenCensus based on the
Expand Down
2 changes: 1 addition & 1 deletion metrics/stackdriver_exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ import (

"contrib.go.opencensus.io/exporter/stackdriver"
"contrib.go.opencensus.io/exporter/stackdriver/monitoredresource"
"knative.dev/pkg/metrics/metricskey"
"go.opencensus.io/stats/view"
"go.opencensus.io/tag"
"go.uber.org/zap"
"knative.dev/pkg/metrics/metricskey"
)

// customMetricTypePrefix is the metric type prefix for unsupported metrics by
Expand Down
4 changes: 2 additions & 2 deletions metrics/stackdriver_exporter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ import (
"testing"

"contrib.go.opencensus.io/exporter/stackdriver"
. "knative.dev/pkg/logging/testing"
"knative.dev/pkg/metrics/metricskey"
"go.opencensus.io/stats"
"go.opencensus.io/stats/view"
"go.opencensus.io/tag"
. "knative.dev/pkg/logging/testing"
"knative.dev/pkg/metrics/metricskey"
)

var (
Expand Down
6 changes: 3 additions & 3 deletions reconciler/testing/table.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@ import (

"github.com/google/go-cmp/cmp"
"github.com/google/go-cmp/cmp/cmpopts"
"knative.dev/pkg/controller"
"knative.dev/pkg/kmeta"
_ "knative.dev/pkg/system/testing" // Setup system.Namespace()
"k8s.io/apimachinery/pkg/api/resource"
"k8s.io/apimachinery/pkg/runtime"
clientgotesting "k8s.io/client-go/testing"
"k8s.io/client-go/tools/cache"
"knative.dev/pkg/controller"
"knative.dev/pkg/kmeta"
_ "knative.dev/pkg/system/testing" // Setup system.Namespace()
)

// TableRow holds a single row of our table test.
Expand Down
4 changes: 2 additions & 2 deletions test/clients.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@ import (
"fmt"
"strings"

"knative.dev/pkg/test/logging"
"knative.dev/pkg/test/spoof"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/client-go/kubernetes"
k8styped "k8s.io/client-go/kubernetes/typed/core/v1"
"k8s.io/client-go/rest"
"k8s.io/client-go/tools/clientcmd"
"knative.dev/pkg/test/logging"
"knative.dev/pkg/test/spoof"
)

// KubeClient holds instances of interfaces for making requests to kubernetes client.
Expand Down
2 changes: 1 addition & 1 deletion test/kube_checks.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@ import (
"strings"
"time"

"knative.dev/pkg/test/logging"
appsv1 "k8s.io/api/apps/v1"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/util/wait"
k8styped "k8s.io/client-go/kubernetes/typed/core/v1"
"knative.dev/pkg/test/logging"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion test/logging/logging.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ import (

"github.com/davecgh/go-spew/spew"
"github.com/golang/glog"
"knative.dev/pkg/logging"
"go.opencensus.io/stats/view"
"go.opencensus.io/trace"
"go.uber.org/zap"
"knative.dev/pkg/logging"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion test/monitoring/monitoring.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ import (
"os/exec"
"strings"

"knative.dev/pkg/test/logging"
v1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/client-go/kubernetes"
"knative.dev/pkg/test/logging"
)

// CheckPortAvailability checks to see if the port is available on the machine.
Expand Down
6 changes: 3 additions & 3 deletions test/spoof/spoof.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ import (
"net/http"
"time"

ingress "knative.dev/pkg/test/ingress"
"knative.dev/pkg/test/logging"
"knative.dev/pkg/test/zipkin"
"github.com/pkg/errors"
"k8s.io/apimachinery/pkg/util/wait"
"k8s.io/client-go/kubernetes"
ingress "knative.dev/pkg/test/ingress"
"knative.dev/pkg/test/logging"
"knative.dev/pkg/test/zipkin"

"go.opencensus.io/plugin/ochttp"
"go.opencensus.io/plugin/ochttp/propagation/b3"
Expand Down
4 changes: 2 additions & 2 deletions test/zipkin/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ import (
"net/http"
"sync"

"knative.dev/pkg/test/logging"
"knative.dev/pkg/test/monitoring"
"go.opencensus.io/trace"
"k8s.io/client-go/kubernetes"
"knative.dev/pkg/test/logging"
"knative.dev/pkg/test/monitoring"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion testing/inner_default_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ package testing
import (
"context"

"knative.dev/pkg/apis"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"knative.dev/pkg/apis"
)

// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
Expand Down
2 changes: 1 addition & 1 deletion testing/resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ import (
"context"
"fmt"

"knative.dev/pkg/apis"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
"knative.dev/pkg/apis"
)

// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
Expand Down
2 changes: 1 addition & 1 deletion tracing/http_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ import (
"testing"

"github.com/google/go-cmp/cmp"
"knative.dev/pkg/tracing/config"
openzipkin "github.com/openzipkin/zipkin-go"
zipkinreporter "github.com/openzipkin/zipkin-go/reporter"
reporterrecorder "github.com/openzipkin/zipkin-go/reporter/recorder"
"knative.dev/pkg/tracing/config"
)

type fakeWriter struct {
Expand Down
2 changes: 1 addition & 1 deletion tracing/opencensus.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ import (
"errors"
"sync"

"knative.dev/pkg/tracing/config"
zipkinmodel "github.com/openzipkin/zipkin-go/model"
zipkinreporter "github.com/openzipkin/zipkin-go/reporter"
"go.opencensus.io/exporter/zipkin"
"go.opencensus.io/trace"
"knative.dev/pkg/tracing/config"
)

// ConfigOption is the interface for adding additional exporters and configuring opencensus tracing.
Expand Down
2 changes: 1 addition & 1 deletion tracing/opencensus_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ import (
"testing"

"github.com/google/go-cmp/cmp"
"knative.dev/pkg/tracing/config"
openzipkin "github.com/openzipkin/zipkin-go"
zipkinreporter "github.com/openzipkin/zipkin-go/reporter"
reporterrecorder "github.com/openzipkin/zipkin-go/reporter/recorder"
"go.opencensus.io/trace"
"knative.dev/pkg/tracing/config"
)

func TestOpenCensusTracerGlobalLifecycle(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion webhook/user_info_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ import (

"github.com/google/go-cmp/cmp"
"github.com/google/go-cmp/cmp/cmpopts"
authenticationv1 "k8s.io/api/authentication/v1"
"knative.dev/pkg/apis"
. "knative.dev/pkg/logging/testing"
. "knative.dev/pkg/testing"
authenticationv1 "k8s.io/api/authentication/v1"
)

func TestSetUserInfoAnnotationsWhenWithinCreate(t *testing.T) {
Expand Down
Loading

0 comments on commit 1864f49

Please sign in to comment.