Registry / utility / lestrrat-go-option

lestrrat-go-option

JSON →
library1.0.1gogounverified

A Go library providing a generic option pattern for functional options in constructors.

go get github.com/lestrrat-go/option
INSTALL
IMPORT
SIG · LESTRRAT-GO-OPTION
L
lestrrat-go-option
utilitygov1.0.1
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

option
github.com/lestrrat-go/option

Create a functional option using the option package.

package main import ( "fmt" "github.com/lestrrat-go/option" ) type Config struct { Name string } func WithName(name string) option.Interface { return option.New("name", name) } func main() { opts := []option.Interface{WithName("test")} fmt.Println(opts) }
Debug
Known issues

No known issues recorded.

Upgrade
Version history
1.0.1latest on pkg.go.dev
Audit
Dependencies

No dependency data recorded yet.

Agent activity
4 hits · last 30 days
node
4
Resources
lestrrat-go-option — go get lestrrat-go-option · libregistry