void

package
v1.20.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 30, 2025 License: MIT Imports: 0 Imported by: 0

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")
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL