Documentation ¶
Index ¶
- func CutLast(s, sep string) (before, after string, found bool)
- func CutPrefix(s, prefix string) (after string, found bool)
- func CutSuffix(s, suffix string) (before string, found bool)
- func CutTwice(s, sep1, sep2 string) (before, between, after string, found bool)
- func ReadJSONFile(path string, i interface{}) (err error)
- func WriteJSONFile(path string, i interface{}) (err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CutLast ¶ added in v0.0.3
CutLast is strings.Cut, but cutting at the last occurrence of sep rather than the first.
func CutPrefix ¶
CutPrefix behaves like strings.Cut, but only cuts a prefix, not anywhere in the string.
func CutSuffix ¶ added in v0.0.3
CutSuffix behaves like strings.Cut, but only cuts a suffix, not anywhere in the string.
func CutTwice ¶
CutTwice calls strings.Cut twice to split s into three strings. If either separator isn't found in s, returns s, "", "", false.
func ReadJSONFile ¶
ReadJSONFile reads one JSON value from the specified file. Supports BOM.
func WriteJSONFile ¶
WriteJSONFile writes one specified value to a file as indented JSON with a trailing newline.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.