mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-02 08:17:26 +00:00
Fixes golint errors in pkg/kubecfg
This commit is contained in:
parent
af38bf1ef7
commit
c6b27bb87d
@ -237,10 +237,12 @@ func (h *HumanReadablePrinter) PrintObj(obj interface{}, output io.Writer) error
|
||||
}
|
||||
}
|
||||
|
||||
// TemplatePrinter is an implementation of ResourcePrinter which formats data with a Go Template.
|
||||
type TemplatePrinter struct {
|
||||
Template *template.Template
|
||||
}
|
||||
|
||||
// Print parses the data as JSON, and re-formats it with the Go Template.
|
||||
func (t *TemplatePrinter) Print(data []byte, w io.Writer) error {
|
||||
obj, err := api.Decode(data)
|
||||
if err != nil {
|
||||
@ -249,6 +251,7 @@ func (t *TemplatePrinter) Print(data []byte, w io.Writer) error {
|
||||
return t.PrintObj(obj, w)
|
||||
}
|
||||
|
||||
// PrintObj formats the obj with the Go Template.
|
||||
func (t *TemplatePrinter) PrintObj(obj interface{}, w io.Writer) error {
|
||||
return t.Template.Execute(w, obj)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user