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

validate

package
v0.1.0-alpha.3 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2026 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Overview

Package validate checks loaded collections for structural problems that a single file cannot reveal: duplicate ids, broken references, unknown node types, dependency cycles, and suspicious characters in values.

Each check is a small function over a shared index; Validate runs them in a fixed order. Positions are filled in later by the store, from the YAML paths recorded here.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Validate

func Validate(t Target) diag.List

Validate runs every check and returns the diagnostics sorted.

Types

type LintFinding

type LintFinding struct {
	Code diag.Code
	Char string
}

LintFinding is one suspicious property of a value. Char is set for invisible characters, as "U+XXXX".

func LintValue

func LintValue(value string) []LintFinding

LintValue reports leading/trailing whitespace, line breaks or tabs, and invisible characters in a single-line value.

type Target

type Target struct {
	Collections []model.Collection
}

Target is everything validated together: all loaded collections, so that cross-collection references can be checked.

Jump to

Keyboard shortcuts

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