{"@context":"https://w3id.org/codemeta/3.0","@type":"SoftwareSourceCode","identifier":"pkg:golang/github.com/jba/weakmap","name":"github.com/jba/weakmap","description":"Package weakmap implements a map with weak keys.\n\nOne use for such a map is storing auxiliary data with values that are not\nunder your control. For example, if you wanted to associated additional\ninformation with values of some type *p.T, where package p is not under your\ncontrol, you could use a weakmap whose keys are *p.T values and whose values\nare your additional information. // The advantage over using an ordinary map\nis that when a *p.T gets garbage-collected, your associated data is removed\nfrom the map.\n\nThis should be considered a proof of concept, for educational purposes only.\nThe problem is that the implementation requires setting a finalizer on the\nkeys, which removes any existing finalizer. There is no way for the program\nto tell if there is an existing finalizer, so it cannot detect this problem.","license":"https://spdx.org/licenses/MIT","codeRepository":"https://github.com/jba/weakmap","issueTracker":"https://github.com/jba/weakmap/issues","url":"https://github.com/jba/weakmap","programmingLanguage":{"@type":"ComputerLanguage","name":"Go"},"dateModified":"2026-02-17","datePublished":"2026-02-17","softwareHelp":{"@type":"WebSite","url":"https://pkg.go.dev/github.com/jba/weakmap#section-documentation"},"applicationCategory":"go","runtimePlatform":"go","developmentStatus":"active","sameAs":["https://pkg.go.dev/github.com/jba/weakmap"]}