Discover Packages
cloud.google.com/go
internal
optional
package
Version:
v0.123.0
Opens a new window with list of versions in this module.
Published: Sep 22, 2025
License: Apache-2.0
Opens a new window with license information.
Imports: 3
Opens a new window with list of imports.
Imported by: 0 modules, 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
¶
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.
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.
Bool is either a bool or nil.
type Duration interface{}
Duration is either a time.Duration or nil.
Float64 is either a float64 or nil.
Int is either an int or nil.
String is either a string or nil.
Uint is either a uint or nil.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.