Help us shape the future of Go! Take the 2026 Go Developer Survey

listkey

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package listkey is the one rule a list keys its items by (D67): the core's ListState, which diffs a list, and the Go client, which applies the diffs, both key with ItemID, as the TypeScript runtime's itemID does in the browser.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ItemID

func ItemID(item json.RawMessage) (string, error)

ItemID is the key a list keys an item by (ListState, and every client applying a ListChange the same way; its errors: no object, no or a null id, an id neither string nor number), read from the member spelled exactly "id" (no case-insensitive alias): a JSON string as it is, a JSON number as JavaScript's Number toString writes it (1, 1.0 and 1e0 are one id; 1234567 stays plain; 1e21 and 1e-7 take exponent form; -0 is 0), so the server and the browser key the same.

Types

This section is empty.

Jump to

Keyboard shortcuts

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