package optional
Import Path
cloud.google.com/go/internal/optional (on go.dev)
Dependency Relation
imports 3 packages, and imported by one package
Involved Source Files
Package optional provides versions of primitive types that can
be nil. These are useful in methods that update some of an API object's
fields.
Package-Level Type Names (total 6, all are exported)
Duration is either a time.Duration or nil.
func ToDuration(v Duration) time.Duration
Package-Level Functions (total 7, in which 6 are exported)
ToBool returns its argument as a bool.
It panics if its argument is nil or not a bool.
ToDuration returns its argument as a time.Duration.
It panics if its argument is nil or not a time.Duration.
ToFloat64 returns its argument as a float64.
It panics if its argument is nil or not a float64.
ToInt returns its argument as an int.
It panics if its argument is nil or not an int.
ToString returns its argument as a string.
It panics if its argument is nil or not a string.
ToUint returns its argument as a uint.
It panics if its argument is nil or not a uint.
![]() |
The pages are generated with Golds v0.3.2-preview. (GOOS=darwin GOARCH=amd64) Golds is a Go 101 project developed by Tapir Liu. PR and bug reports are welcome and can be submitted to the issue list. Please follow @Go100and1 (reachable from the left QR code) to get the latest news of Golds. |