Documentation ¶
Index ¶
- Variables
- func CopyTo(src *paths.Path, dst *paths.Path) error
- func DecodeHexInString(str string) string
- func Filter(src string) string
- func MustReadFile(path *paths.Path) string
- func MustReadFileAsLines(path *paths.Path) []string
- func ReadFile(path *paths.Path) (string, error)
- func RemoveDuplicate[T comparable](inlist []T) []T
- type RegexRepl
- type RegexReplList
Constants ¶
This section is empty.
Variables ¶
View Source
var (
Comment = `#`
)
Functions ¶
func DecodeHexInString ¶
DecodeHexInString decode and replace all hex value in a given string of "key=value" format.
func MustReadFile ¶
MustReadFile read a file and return its content as a string. Panic if an error occurs.
func MustReadFileAsLines ¶
MustReadFileAsLines read a file and return its content as a slice of string. It panics if an error occurs and filter out comments and empty lines.
func RemoveDuplicate ¶
func RemoveDuplicate[T comparable](inlist []T) []T
RemoveDuplicate filter out all duplicates from a slice. Also filter out empty element.
Types ¶
type RegexReplList ¶
type RegexReplList []RegexRepl
func ToRegexRepl ¶
func ToRegexRepl(in []string) RegexReplList
ToRegexRepl convert slice of regex into a slice of RegexRepl
func (RegexReplList) Replace ¶
func (rr RegexReplList) Replace(str string) string
Click to show internal directories.
Click to hide internal directories.