diff --git a/internal/view/dir.go b/internal/view/dir.go index 15830f4a..67f41c4a 100644 --- a/internal/view/dir.go +++ b/internal/view/dir.go @@ -22,6 +22,7 @@ type Dir struct { path string } +// NewDir returns a new instance. func NewDir(path string) ResourceViewer { d := Dir{ ResourceViewer: NewBrowser(client.NewGVR("dir")), diff --git a/internal/view/log.go b/internal/view/log.go index 9218a383..ceffd670 100644 --- a/internal/view/log.go +++ b/internal/view/log.go @@ -4,7 +4,6 @@ import ( "bytes" "context" "fmt" - "github.com/atotto/clipboard" "io" "os" "path/filepath" @@ -12,6 +11,8 @@ import ( "strings" "time" + "github.com/atotto/clipboard" + "github.com/derailed/k9s/internal/client" "github.com/derailed/k9s/internal/color" "github.com/derailed/k9s/internal/config" @@ -241,6 +242,7 @@ func (l *Log) Logs() *Details { return l.logs } +// EOL tracks end of lines. var EOL = []byte("\n") // Flush write logs to viewer. diff --git a/internal/watch/factory.go b/internal/watch/factory.go index 6ec969e1..300081aa 100644 --- a/internal/watch/factory.go +++ b/internal/watch/factory.go @@ -277,7 +277,7 @@ func (f *Factory) ForwarderFor(path string) (Forwarder, bool) { return fwd, ok } -// Validate check if pods are still around for portforwards. +// ValidatePortForwards check if pods are still around for portforwards. func (f *Factory) ValidatePortForwards() { for k, fwd := range f.forwarders { tokens := strings.Split(k, ":") diff --git a/internal/watch/forwarders.go b/internal/watch/forwarders.go index 8e6b232d..c1fd899c 100644 --- a/internal/watch/forwarders.go +++ b/internal/watch/forwarders.go @@ -49,7 +49,7 @@ func NewForwarders() Forwarders { return make(map[string]Forwarder) } -// IsForwarded checks if pod has a forward +// IsPodForwarded checks if pod has a forward func (ff Forwarders) IsPodForwarded(path string) bool { for k := range ff { fqn := strings.Split(k, ":")