utils

package
v1.1.9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 17, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateYamlFile

func CreateYamlFile(fileName, content string) error

CreateYamlFile creates a YAML file with given name and content safely.

func PrintJSON added in v1.1.6

func PrintJSON(v interface{}) error

PrintJSON marshals v as indented JSON and writes it, and nothing else, to stdout. It is meant for the -o json path of read-only commands: callers must not emit any other stdout output (spinners, pterm messages, AI explanations) alongside it, so a pipeline consuming stdout only ever sees the JSON document.

func ValidOutputFormat added in v1.1.6

func ValidOutputFormat(format string, allowed ...string) bool

ValidOutputFormat reports whether format is one of allowed. Used by read-only commands that support -o/--output to reject an unknown value with a clear error instead of silently falling back to the default.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL