Documentation
¶
Index ¶
- func Capitalize(s string) string
- func ColoredUnifiedDiff(from, to string, diffContextLines int) string
- func EscapeForMarkdown(s string) string
- func EscapeForMarkdownPreservingCodeSpans(s string) string
- func JSONPatchPathToJSONPath(path string) string
- func MergeJSON(mergeA, toB []byte) (result []byte, changed bool, err error)
- func NewRestyClient(ctx context.Context) *resty.Client
- func ParseProperties(ctx context.Context, input string) (map[string]any, error)
- func SubtractJSON(fromA, subtractB []byte) (result []byte, changed bool, err error)
- func Uint64ToInt(v uint64) int
- type MultiError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Capitalize ¶
func ColoredUnifiedDiff ¶
func EscapeForMarkdown ¶ added in v1.21.0
EscapeForMarkdown escapes all Markdown special characters in the input string by prefixing them with a backslash.
func EscapeForMarkdownPreservingCodeSpans ¶ added in v1.21.0
EscapeForMarkdownPreservingCodeSpans escapes Markdown special characters but preserves text within backtick code spans and indented code blocks.
func JSONPatchPathToJSONPath ¶ added in v1.13.0
func ParseProperties ¶
This is a pretty well-thought-out properties parser using a finite state machine (FSM). We should use it more, especially in annotations.
func SubtractJSON ¶ added in v1.13.0
func Uint64ToInt ¶ added in v1.13.0
Types ¶
type MultiError ¶ added in v1.21.0
type MultiError struct {
// contains filtered or unexported fields
}
MultiError collects multiple errors and formats them as a flat list. Nested MultiErrors wrapped with fmt.Errorf are automatically flattened, with wrapper prefixes prepended to each inner error.
func (*MultiError) Add ¶ added in v1.21.0
func (m *MultiError) Add(errs ...error) *MultiError
Add appends errors to the collection. Nil errors are ignored. Returns the MultiError for chaining.
func (*MultiError) Error ¶ added in v1.21.0
func (m *MultiError) Error() string
Error returns formatted error string. Single error is returned as-is. Multiple errors are formatted as "N errors occurred:\n * err1\n * err2". Nested MultiErrors are flattened with their wrapper chain as prefix.
func (*MultiError) HasErrors ¶ added in v1.21.0
func (m *MultiError) HasErrors() bool
func (*MultiError) OrNilIfNoErrs ¶ added in v1.21.0
func (m *MultiError) OrNilIfNoErrs() error
func (*MultiError) Unwrap ¶ added in v1.21.0
func (m *MultiError) Unwrap() []error