Skip to content

A simple non-funky package with functions to represent Go's built-in value types to and from nil pointers.

License

Notifications You must be signed in to change notification settings

bithavoc/goptionals

Repository files navigation

Go Optionals Values

Tests Status GoCover Go Report Card Go Reference

A simple non-funky package with functions to represent Go's built-in value types to and from nil pointers.

Example:

optionalString := goptionals.String("foo") // *string
optionalString = nil
nonOptional := goptionals.StringValue(optionalString) // ""

Test

go test

with coverage:

go test -coverprofile=coverage.out && go tool cover -html=coverage.out

About

A simple non-funky package with functions to represent Go's built-in value types to and from nil pointers.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages