util

package
v1.129.3 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CleanUpYaml

func CleanUpYaml(value string) string

CleanUpYaml removes lines that only contain comments or are empty also removes trailing comments after the "---" multi doc separator

func CommonSlicePrefix

func CommonSlicePrefix(a, b []string) []string

CommonSlicePrefix returns the common prefix of two string slices

func GetLineIndentation

func GetLineIndentation(line string) string

GetLineIndentation returns the indentation (whitespace prefix) of a line

func GetLineNumberForDoc

func GetLineNumberForDoc(content string, docIndex int) (int, error)

GetLineNumberForDoc returns the line number of the first line of a document (disregards empty lines and comments)

func GetLineNumberFromMatch

func GetLineNumberFromMatch(content string, match string, docIndex int) (int, error)

GetLineNumberFromMatch returns the line number for a given substring in "content"

func GetLineNumberFromYamlPath

func GetLineNumberFromYamlPath(content string, path string, docIndex int) (int, error)

GetLineNumberFromYamlPath returns the line number in a yaml text given the yaml path pass 0 as docIndex in case of a single yaml document

func GetStringInBetween

func GetStringInBetween(str, start, end string) string

GetStringInBetween returns empty string if no start/end string found

func IsLineEmpty

func IsLineEmpty(line string) bool

IsLineEmpty returns true if a line is empty or a comment

func TryGetLineNumberFromValue

func TryGetLineNumberFromValue(value string) (int, error)

TryGetLineNumberFromValue attempts to extract a line number from an error message

Types

This section is empty.

Jump to

Keyboard shortcuts

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