once

package
v0.0.30 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2025 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Do

func Do[T any](fn func() T) func() T

Do 单例模式

func DoWithErr

func DoWithErr[T any](fn func() (T, error)) func() (T, error)

DoWithErr 单例模式, 返回泛型和错误

func DoWithParam

func DoWithParam[T any, P any](fn func(P) T) func(P) T

DoWithParam 单例带参数模式 泛型函数

Types

This section is empty.

Jump to

Keyboard shortcuts

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