util

package
v0.3.9 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CleanUpYaml added in v0.1.0

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 added in v0.2.0

func CommonSlicePrefix(first []string, second []string) []string

func GetLineIndentation added in v0.0.6

func GetLineIndentation(line string) string

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 added in v0.0.8

func GetStringInBetween(str, start, end string) string

GetStringInBetween Returns empty string if no start/end string found

func IsLineEmpty added in v0.0.6

func IsLineEmpty(line string) bool

func IsTarFile added in v0.0.7

func IsTarFile(value []byte) bool

func TryGetLineNumberFromValue

func TryGetLineNumberFromValue(value string) (int, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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