mirror of
https://github.com/helm/helm.git
synced 2026-08-04 15:10:47 +00:00
@@ -102,7 +102,7 @@ type Writer interface {
|
||||
|
||||
// EncodeJSON is a helper function to decorate any error message with a bit more
|
||||
// context and avoid writing the same code over and over for printers.
|
||||
func EncodeJSON(out io.Writer, obj interface{}) error {
|
||||
func EncodeJSON(out io.Writer, obj any) error {
|
||||
enc := json.NewEncoder(out)
|
||||
err := enc.Encode(obj)
|
||||
if err != nil {
|
||||
@@ -113,7 +113,7 @@ func EncodeJSON(out io.Writer, obj interface{}) error {
|
||||
|
||||
// EncodeYAML is a helper function to decorate any error message with a bit more
|
||||
// context and avoid writing the same code over and over for printers
|
||||
func EncodeYAML(out io.Writer, obj interface{}) error {
|
||||
func EncodeYAML(out io.Writer, obj any) error {
|
||||
raw, err := yaml.Marshal(obj)
|
||||
if err != nil {
|
||||
return fmt.Errorf("unable to write YAML output: %w", err)
|
||||
|
||||
Reference in New Issue
Block a user