Documentation
¶
Overview ¶
Package void provides a Void type for representing the absence of a value.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Void ¶
type Void = *struct{}
Void is a type that represents the absence of a value.
Void is commonly used with Result to create VoidResult (Result[Void]), which represents operations that only return success or failure without a value. This is equivalent to Rust's Result<(), E>.
Examples ¶
// Use with Result
var result result.VoidResult = result.RetVoid(err)
if result.IsErr() {
fmt.Println(result.Err())
}
// Use with OkVoid
var success result.VoidResult = result.OkVoid()
if success.IsOk() {
fmt.Println("Operation succeeded")
}
Click to show internal directories.
Click to hide internal directories.