Discover Packages
github.com/dracory/neat
support
convert
package
Version:
v0.56.0
Opens a new window with list of versions in this module.
Published: Oct 9, 2026
License: AGPL-3.0
Opens a new window with license information.
Imports: 0
Opens a new window with list of imports.
Imported by: 1 module, 0 packages
The first number is the count of modules that contain a package that imports this one.
The module count is a better indicator of popularity than the package count.
A module with 100 importing packages is counted only once instead of 100 times,
reflecting the fact that the choice to use the package was likely made only once,
not 100 times.
A '?' means that the value hasn't been computed yet.
Opens a new window with list of known importers.
Documentation
Documentation
¶
Default returns the first non-zero value.
If all values are zero, return the zero value.
Default("", "foo") // "foo"
Default("bar", "foo") // "bar"
Default("", "", "foo") // "foo"
func Pointer[T any ](value T) *T
Pointer returns a pointer to the value.
Pointer("foo") // *string("foo")
Pointer(1) // *int(1)
func Tap[T any ](value T, callbacks ...func(T)) T
Tap calls the given callback with the given value then returns the value.
Tap("foo", func(s string) {
fmt.Println(s) // "foo" and os.Stdout will print "foo"
}, func(s string) {
// more callbacks
}...)
func Transform[T, R any ](value T, callback func(T) R) R
Transform calls the given callback with the given value then return the result.
Transform(1, strconv.Itoa) // "1"
Transform("foo", func(s string) *foo {
return &foo{Name: s}
}) // &foo{Name: "foo"}
func With[T any ](value T, callbacks ...func(T) T) T
With calls the given callbacks with the given value then return the value.
With("foo", func(s string) string {
return s + "bar"
}, func(s string) string {
return s + "baz"
}) // "foobarbaz"
Source Files
¶
Click to show internal directories.
Click to hide internal directories.