mak
packageThis package is not in the latest version of its module.
Details
Validgo.mod file
The Go module system was introduced in Go 1.11 and is the official dependency management solution for Go.
Redistributable license
Redistributable licenses place minimal restrictions on how software can be used, modified, and redistributed.
Tagged version
Modules with tagged versions give importers more predictable builds.
Stable version
When a project reaches major version v1 it is considered stable.
- Learn more about best practices
Repository
Links
Documentation¶
Overview¶
Package mak helps make maps. It contains generic helpers to make/assignthings, notably to maps, but also slices.
Index¶
Constants¶
This section is empty.
Variables¶
This section is empty.
Functions¶
funcNonNilMapForJSON¶added inv1.32.0
func NonNilMapForJSON[Kcomparable, Vany, M ~map[K]V](mapPtr *M)
NonNilMapForJSON makes sure that *slicePtr is non-nil so it willwon't be omitted from JSON serialization and possibly confuse JavaScriptclients expecting it to be present.
funcNonNilSliceForJSON¶added inv1.32.0
func NonNilSliceForJSON[Tany, S ~[]T](slicePtr *S)
NonNilSliceForJSON makes sure that *slicePtr is non-nil so it willwon't be omitted from JSON serialization and possibly confuse JavaScriptclients expecting it to be present.
funcSet¶
func Set[Kcomparable, Vany, T ~map[K]V](m *T, k K, v V)
Set populates an entry in a map, making the map if necessary.
That is, it assigns (*m)[k] = v, making *m if it was nil.
Types¶
This section is empty.