Discover Packages
tailscale.com
types
result
package
Version:
v1.104.6
Opens a new window with list of versions in this module.
Published: Nov 10, 2026
License: BSD-3-Clause
Opens a new window with license information.
Imports: 0
Opens a new window with list of imports.
Imported by: 2 modules, 1 package
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 result contains the Of result type, which is
either a value or an error.
type Of[T any ] struct {
}
Of is either a T value or an error.
Think of it like Rust or Swift's result types.
It's named "Of" because the fully qualified name
for callers reads result.Of[T].
Error returns a new result with error err.
If err is nil, the returned result is equivalent
to calling Value with T's zero value.
func Value[T any ](v T) Of [T]
Value returns a new result with value v,
without an error.
Err returns r's error, if any.
When r.Err returns nil, it's safe to call r.MustValue without it panicking.
func (r Of [T]) MustValue() T
MustValue returns r's result value.
It panics if r.Err returns non-nil.
Value returns r's result value and error.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.