points

package
v2.9.2 Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2026 License: Apache-2.0 Imports: 1 Imported by: 0

README

便捷指针

package main

import (
	. `fmt`

	"github.com/aid297/aid/v2/ptr"
)

func main() {
	a := ptr.New(123)
	Printf("%#v\n", a)

	b := ptr.New("张三")
	Printf("%#v\n", b)

	c := ptr.New('a')
	Printf("%#v\n", c)
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Default added in v2.6.9

func Default[T any](val *T, def T) T

func DefaultNil added in v2.6.9

func DefaultNil[T any](val *T, def T) T

func New

func New[T any](val T) *T

func Value

func Value[T any](val *T) T

Types

This section is empty.

Jump to

Keyboard shortcuts

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