Documentation
¶
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Must ¶ added in v0.19.4
Must panics if the passed error is not nil
The purpose of this function is ignoring error checking when writing tests and only tests. This should not be used on production code.
Example (WithError) ¶
// Following line will panic as there is an error Must("abc", errors.New("an error"))
Output:
Example (WithNoError) ¶
// Following line will not panic as there is no error result := Must("abc", nil) // Should print "abc" fmt.Println(result)
Output:
func RemoveDuplicateFromSlice ¶ added in v0.19.2
RemoveDuplicateFromSlice removes duplicate values from a slice.
func ToPointer ¶ added in v0.19.2
func ToPointer[T any](t T) *T
ToPointer returns a pointer to the given value.
func ToValue ¶ added in v0.19.2
func ToValue[T any](t *T) T
ToValue returns the value pointed by the given pointer.
func UpperFirstLetter ¶ added in v0.9.0
UpperFirstLetter returns the given string with the first letter in uppercase.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.