files

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2025 License: Apache-2.0 Imports: 4 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateFileDirs

func CreateFileDirs(fullPath string) (err error)

CreateFileDirs creates the directories for a file path if they do not exist.

func IsJson

func IsJson(path string) (err error)

func IsJsonOrYaml

func IsJsonOrYaml(path string) (err error)

isJsonOrYaml returns error if the file is not a json or yaml file.

func RemoveTrailingWhitespace

func RemoveTrailingWhitespace(bytes []byte) []byte

RemoveTrailingWhitespace removes trailing whitespace from each line in a byte array. This is useful for removing trailing whitespace from a yaml file before it is marshalled into a struct. Prevents strings from being collapsed into a single line by yaml parser.

func WriteOutput

func WriteOutput(output []byte, outputFile string) (err error)

WriteOutput writes to the provided output file or to stdout by default.

Types

This section is empty.

Jump to

Keyboard shortcuts

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