You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
tailscale/types
Joe Tsai c299a96624 all: apply consistent imports of "json" packages
This runs:

        go run ./cmd/jsonimports -update -ignore=tempfork/

which applies the following rules:

  * Until the Go standard library formally accepts "encoding/json/v2"
    and "encoding/json/jsontext" into the standard library
    (i.e., they are no longer considered experimental),
    we forbid any code from directly importing those packages.
    Go code should instead import "github.com/go-json-experiment/json"
    and "github.com/go-json-experiment/json/jsontext".
    The latter packages contain aliases to the standard library
    if built on Go 1.25 with the goexperiment.jsonv2 tag specified.

  * Imports of "encoding/json" or "github.com/go-json-experiment/json/v1"
    must be explicitly imported under the package name "jsonv1".
    If both packages need to be imported, then
    the former should be imported under the package name "jsonv1std".

  * Imports of "github.com/go-json-experiment/json"
    must be explicitly imported under the package name "jsonv2".

The latter two rules exist to provide clarity when reading code.
Without them, it is unclear whether "json.Marshal" refers to v1 or v2.
With them, however, it is clear that "jsonv1.Marshal" is calling v1 and
that "jsonv2.Marshal" is calling v2.

Updates tailscale/corp#791

Signed-off-by: Joe Tsai <joetsai@digital-static.net>
4 weeks ago
..
appctype all: apply consistent imports of "json" packages 4 weeks ago
bools types/bools: fix doc typo (#15021) 10 months ago
dnstype types/dnstype: delete unused func, move other one to its sole caller 2 months ago
empty all: update copyright and license headers 3 years ago
flagtype all: update copyright and license headers 3 years ago
geo types/geo: add geo.Point and its associated units (#16583) 5 months ago
iox types/iox: add function types for Reader and Writer (#14366) 12 months ago
ipproto all: apply consistent imports of "json" packages 4 weeks ago
jsonx all: apply consistent imports of "json" packages 4 weeks ago
key all: apply consistent imports of "json" packages 4 weeks ago
lazy types/lazy: document difference from sync.OnceValue 2 months ago
logger all: apply consistent imports of "json" packages 4 weeks ago
logid types/logid: add Add method (#12478) 1 year ago
mapx types/mapx, ipn/ipnext: add ordered map, akin to set.Slice 7 months ago
netlogfunc net/connstats: prepare to remove package (#17554) 2 months ago
netlogtype all: apply consistent imports of "json" packages 4 weeks ago
netmap all: apply consistent imports of "json" packages 4 weeks ago
nettype wgengine/magicsock, types/nettype, etc: finish ReadFromUDPAddrPort netip migration 3 years ago
opt all: apply consistent imports of "json" packages 4 weeks ago
persist Revert "control/controlclient: back out HW key attestation (#17664)" (#17732) 1 month ago
prefs all: apply consistent imports of "json" packages 4 weeks ago
preftype cmd/tailscaled,*: add start of configuration file support 2 years ago
ptr all: update copyright and license headers 3 years ago
result types/result, util/lineiter: add package for a result type, use it 1 year ago
structs all: update copyright and license headers 3 years ago
tkatype all: apply consistent imports of "json" packages 4 weeks ago
views types/views: add min/max helpers to views.Slice 4 months ago