mak

package
v1.104.2 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2026 License: BSD-3-Clause Imports: 0 Imported by: 15 modules, 77 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package mak helps make maps. It contains generic helpers to make/assign things, notably to maps, but also slices.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NonNilMapForJSON added in v1.32.0

func NonNilMapForJSON[K comparable, V any, M ~map[K]V](mapPtr *M)

NonNilMapForJSON makes sure that *slicePtr is non-nil so it will won't be omitted from JSON serialization and possibly confuse JavaScript clients expecting it to be present.

func NonNilSliceForJSON added in v1.32.0

func NonNilSliceForJSON[T any, S ~[]T](slicePtr *S)

NonNilSliceForJSON makes sure that *slicePtr is non-nil so it will won't be omitted from JSON serialization and possibly confuse JavaScript clients expecting it to be present.

func Set

func Set[K comparable, V any, 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.

Jump to

Keyboard shortcuts

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