kubectx/internal/cmdutil/deprecated.go
Ahmet Alp Balkan 7f3f0699b3
Extend CI workflow with gofmt
Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
2020-04-29 13:28:12 -07:00

23 lines
439 B
Go

package cmdutil
import (
"io"
"strings"
"github.com/ahmetb/kubectx/internal/printer"
)
func PrintDeprecatedEnvWarnings(out io.Writer, vars []string) {
for _, vv := range vars {
parts := strings.SplitN(vv, "=", 2)
if len(parts) != 2 {
continue
}
key := parts[0]
if key == `KUBECTX_CURRENT_FGCOLOR` || key == `KUBECTX_CURRENT_BGCOLOR` {
printer.Warning(out, "%s environment variable is now deprecated", key)
}
}
}