mirror of
https://github.com/ahmetb/kubectx.git
synced 2025-09-09 12:29:07 +00:00
Extend CI workflow with gofmt
Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
This commit is contained in:
@@ -16,7 +16,7 @@ func PrintDeprecatedEnvWarnings(out io.Writer, vars []string) {
|
||||
key := parts[0]
|
||||
|
||||
if key == `KUBECTX_CURRENT_FGCOLOR` || key == `KUBECTX_CURRENT_BGCOLOR` {
|
||||
printer.Warning(out,"%s environment variable is now deprecated", key)
|
||||
printer.Warning(out, "%s environment variable is now deprecated", key)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -6,19 +6,18 @@ import (
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestPrintDeprecatedEnvWarnings_noDeprecatedVars(t *testing.T){
|
||||
func TestPrintDeprecatedEnvWarnings_noDeprecatedVars(t *testing.T) {
|
||||
var out bytes.Buffer
|
||||
PrintDeprecatedEnvWarnings(&out, []string{
|
||||
"A=B",
|
||||
"PATH=/foo:/bar:/bin",
|
||||
})
|
||||
if v := out.String(); len(v) > 0{
|
||||
if v := out.String(); len(v) > 0 {
|
||||
t.Fatalf("something written to buf: %v", v)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
func TestPrintDeprecatedEnvWarnings_bgColors(t *testing.T){
|
||||
func TestPrintDeprecatedEnvWarnings_bgColors(t *testing.T) {
|
||||
var out bytes.Buffer
|
||||
|
||||
PrintDeprecatedEnvWarnings(&out, []string{
|
||||
@@ -26,10 +25,10 @@ func TestPrintDeprecatedEnvWarnings_bgColors(t *testing.T){
|
||||
"KUBECTX_CURRENT_BGCOLOR=2",
|
||||
})
|
||||
v := out.String()
|
||||
if !strings.Contains(v, "KUBECTX_CURRENT_FGCOLOR"){
|
||||
if !strings.Contains(v, "KUBECTX_CURRENT_FGCOLOR") {
|
||||
t.Fatalf("output doesn't contain 'KUBECTX_CURRENT_FGCOLOR': %q", v)
|
||||
}
|
||||
if !strings.Contains(v, "KUBECTX_CURRENT_BGCOLOR"){
|
||||
if !strings.Contains(v, "KUBECTX_CURRENT_BGCOLOR") {
|
||||
t.Fatalf("output doesn't contain 'KUBECTX_CURRENT_BGCOLOR': %q", v)
|
||||
}
|
||||
}
|
||||
|
@@ -12,7 +12,7 @@ var (
|
||||
ActiveItemColor = color.New(color.FgGreen, color.Bold)
|
||||
)
|
||||
|
||||
func init(){
|
||||
func init() {
|
||||
EnableOrDisableColor(ActiveItemColor)
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user