Backward
The Backward registry offers functions to maintain compatibility with older Sprig versions, ensuring legacy templates continue to work seamlessly after updates.
Deprecated functions
fail ⚠️
The Fail function creates an error with a specified message and returns a nil pointer along with the error. It is generally used to indicate failure in functions that return both a pointer and an error.
[DEPRECATED] No replacement are scheduled yet. If you need this function, open an issue to clearly explain the usage.
Signature
{{ fail "Operation failed" }} // Error with "Operation failed"urlParse ⚠️
The function parses a given URL string and returns a map containing its components, such as the scheme, host, path, query parameters, and more, allowing easy access and manipulation of the different parts of a URL.
[DEPRECATED] No replacement are scheduled yet. If you need this function, open an issue to clearly explain the usage.
Signature
{{ "https://example.com/path?query=1#fragment" | urlParse }}
// Output: map[fragment:fragment host:example.com hostname:example.com path:path query:query scheme:https]urlJoin ⚠️
The function constructs a URL string from a given map of URL components, assembling the various parts such as scheme, host, path, and query parameters into a complete URL.
[DEPRECATED] No replacement are scheduled yet. If you need this function, open an issue to clearly explain the usage.
Signature
getHostByName⚠️
The function returns a random IP address associated with a given hostname, providing a way to resolve a hostname to one of its corresponding IP addresses.
[DEPRECATED] No replacement are scheduled yet. If you need this function, open an issue to clearly explain the usage.
Signature
Last updated