Documentation
¶
Index ¶
Constants ¶
const RequiredErrorCodeString = "required"
const RequiredErrorMessage = "property is required but was empty"
Variables ¶
This section is empty.
Functions ¶
func FindModuleRoot ¶
func FindModuleRoot() string
FindModuleRoot finds the root of the current module. It does so by looking for a go.mod file in the current working directory.
func IsEmpty ¶
func IsEmpty(v interface{}) bool
IsEmptyFunc verifies if the value is zero value of its type.
func JoinErrors ¶
JoinErrors joins multiple errors into a single pretty-formatted string. JoinErrors assumes the errors are not nil, if this presumption is broken the formatting might not be correct.
func PrettyStringListBuilder ¶
PrettyStringListBuilder writes a list of arbitrary values to the provided strings.Builder. It produces a human-readable comma-separated list. Example:
PrettyStringListBuilder(b, []string{"foo", "bar"}, "") -> "foo, bar"
PrettyStringListBuilder(b, []string{"foo", "bar"}, "'") -> "'foo', 'bar'"
func PropertyValueString ¶
func PropertyValueString(v interface{}) string
PropertyValueString returns the string representation of the given value. Structs, interfaces, maps and slices are converted to compacted JSON strings (see struct exceptions below). It tries to improve readability by:
- limiting the string to 100 characters
- removing leading and trailing whitespaces
- escaping newlines
If value is a struct implementing fmt.Stringer fmt.Stringer.String method will be used only if:
- the struct does not contain any JSON tags
- the struct is not empty or it is empty but does not have any fields
If a value is a struct of type time.Time it will be formatted using time.RFC3339 layout.
Types ¶
This section is empty.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package assert provides utility functions for testing which help assert provided conditions are met.
|
Package assert provides utility functions for testing which help assert provided conditions are met. |
|
cmd
|
|
|
docextractor
command
|
|
|
Package collections provides a set of utilities for working with collections, such as slices and maps.
|
Package collections provides a set of utilities for working with collections, such as slices and maps. |
|
Package examples contains examples of how to use the library which are embedded in main README.md.
|
Package examples contains examples of how to use the library which are embedded in main README.md. |
|
Package jsonpath provides utilities for working with [JSONPath RFC-9535], which is primarily used in govy for constructing property names.
|
Package jsonpath provides utilities for working with [JSONPath RFC-9535], which is primarily used in govy for constructing property names. |
|
Package logging is responsible for setting up log/slog configuration.
|
Package logging is responsible for setting up log/slog configuration. |
|
Package messagetemplates TODO
|
Package messagetemplates TODO |
|
Package nameinfer provides utilities for inferring struct member names.
|
Package nameinfer provides utilities for inferring struct member names. |
|
Package stringconvert provides utility functions for converting different types to string.
|
Package stringconvert provides utility functions for converting different types to string. |