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

jsonsrc

package
v0.1.14 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package jsonsrc indexes authored JSON documents by field path so diagnostics can point at the exact key that caused them.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Child

func Child(parent, key string) string

func Parent

func Parent(key string) string

func Within

func Within(child, parent string) bool

Types

type Sources

type Sources struct {
	Raw       map[string][]byte
	Locations map[string]diagnostic.Location
	Leaves    map[string]diagnostic.Location
	Issues    []diagnostic.Diagnostic
	// contains filtered or unexported fields
}

Sources indexes authored JSON fields using encoding/json's token stream. Values are never quoted in diagnostics; only paths, types and locations are.

func Index

func Index(files map[string][]byte) Sources

func (Sources) Nearest

func (s Sources) Nearest(key string) (diagnostic.Location, bool)

Jump to

Keyboard shortcuts

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