nilslices

package
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package nilslices makes nil slices empty before encoding/json sees them. encoding/json writes a nil slice as null; Tern sends [] for pages, typed endpoints and live components instead, so their TypeScript types are T[] rather than T[] | null. Remove copies only what lies on a path to a nil slice: everything else is shared, never changed, so data cached across requests is safe. Values that encode themselves are left to do so.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Remove

func Remove(v any) any

Remove returns v, or a copy of it with nil slices made empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

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