cleaning up

mine
derailed 2021-08-07 07:24:34 -06:00
parent 8e41b76edf
commit 13d52f120f
8 changed files with 8 additions and 3 deletions

View File

@ -7,12 +7,12 @@ import (
"os"
"path/filepath"
"github.com/adrg/xdg"
"github.com/derailed/k9s/internal/client"
"github.com/rs/zerolog/log"
"gopkg.in/yaml.v2"
v1 "k8s.io/api/core/v1"
"k8s.io/cli-runtime/pkg/genericclioptions"
"github.com/adrg/xdg"
)
// K9sConfig represents K9s configuration dir env var.

View File

@ -43,7 +43,7 @@ func NewK9s() *K9s {
}
}
// ActiveCluster initializes the active cluster is not present.
// ActivateCluster initializes the active cluster is not present.
func (k *K9s) ActivateCluster() {
if _, ok := k.Clusters[k.CurrentCluster]; ok {
return

View File

@ -53,6 +53,7 @@ func (c *Cow) Init(_ context.Context) error {
return nil
}
// InCmdMode checks if prompt is active.
func (*Cow) InCmdMode() bool {
return false
}

View File

@ -23,7 +23,7 @@ func (e Env) Substitute(arg string) (string, error) {
// To prevent the substitution starts with the shorter environment variable,
// sort with the length of the found environment variables.
sort.Slice(kk, func (i, j int) bool {
sort.Slice(kk, func(i, j int) bool {
return len(kk[i]) > len(kk[j])
})

View File

@ -59,6 +59,7 @@ func (h *Help) Init(ctx context.Context) error {
return nil
}
// InCmdMode checks if prompt is active.
func (*Help) InCmdMode() bool {
return false
}

View File

@ -98,6 +98,7 @@ func (l *Log) Init(ctx context.Context) (err error) {
return nil
}
// InCmdMode checks if prompt is active.
func (v *Log) InCmdMode() bool {
return v.logs.cmdBuff.InCmdMode()
}

View File

@ -49,6 +49,7 @@ func (p *Picker) Init(ctx context.Context) error {
return nil
}
// InCmdMode checks if prompt is active.
func (*Picker) InCmdMode() bool {
return false
}

View File

@ -52,6 +52,7 @@ func (t *Table) Init(ctx context.Context) (err error) {
return nil
}
// HeaderIndex returns index of a given column or false if not found.
func (t *Table) HeaderIndex(header string) (int, bool) {
for i := 0; i < t.GetColumnCount(); i++ {
if h := t.GetCell(0, i); h != nil && h.Text == header {