weak

command
v0.5.39 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2025 License: MIT Imports: 4 Imported by: 0

README

Go 1.24 で追加された weak パッケージのサンプル

Go 1.24 にて weak パッケージが追加された。弱参照をサポートするライブラリ。

$ task
task: [default] go run main.go
[init  ] HeapAlloc:    185.22 KB (ヒープメモリ)
[before] HeapAlloc:     32.19 MB (ヒープメモリ)
[after ] HeapAlloc:     32.19 MB (ヒープメモリ)
object is nil? ==> false
task: [default] sleep 1
task: [default] go run main.go -weakref
[init  ] HeapAlloc:    185.50 KB (ヒープメモリ)
[before] HeapAlloc:     32.19 MB (ヒープメモリ)
[after ] HeapAlloc:    194.81 KB (ヒープメモリ)
object is nil? ==> true

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

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