Lint go code (#5132)

This commit is contained in:
Manuel Alejandro de Brito Fontes 2020-02-19 21:43:14 -03:00 committed by GitHub
parent f6c0faa6eb
commit 57fcbdfb73
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 60 additions and 49 deletions

View file

@ -21,8 +21,7 @@ import (
"os"
"time"
. "github.com/onsi/ginkgo"
"github.com/onsi/ginkgo"
corev1 "k8s.io/api/core/v1"
apierrors "k8s.io/apimachinery/pkg/api/errors"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
@ -46,7 +45,7 @@ func nowStamp() string {
}
func log(level string, format string, args ...interface{}) {
fmt.Fprintf(GinkgoWriter, nowStamp()+": "+level+": "+format+"\n", args...)
fmt.Fprintf(ginkgo.GinkgoWriter, nowStamp()+": "+level+": "+format+"\n", args...)
}
// Logf logs to the INFO logs.
@ -58,14 +57,14 @@ func Logf(format string, args ...interface{}) {
func Failf(format string, args ...interface{}) {
msg := fmt.Sprintf(format, args...)
log("INFO", msg)
Fail(nowStamp()+": "+msg, 1)
ginkgo.Fail(nowStamp()+": "+msg, 1)
}
// Skipf logs to the INFO logs and skips the test.
func Skipf(format string, args ...interface{}) {
msg := fmt.Sprintf(format, args...)
log("INFO", msg)
Skip(nowStamp() + ": " + msg)
ginkgo.Skip(nowStamp() + ": " + msg)
}
// RestclientConfig deserializes the contents of a kubeconfig file into a Config object.