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

doclint

package
v1.9.0 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package doclint holds the repository's self-checks: tests that read the tree rather than the code, such as whether an environment file is tracked or whether the documentation names identifiers that exist.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExportedIdentifiers

func ExportedIdentifiers(root string) (map[string]Exported, error)

ExportedIdentifiers parses every non-test Go file under root (skipping vendor, testdata and generated SDKs) and returns exports by package name. Two packages sharing a name are merged, which is the right answer for a doc sample that names only the short package name.

Types

type Exported

type Exported map[string]bool

Exported is what a package exports, by identifier: top-level names and the methods of its types. Methods are keyed as Type.Method as well as Method alone, so a sample calling engine.SignIn resolves by method name.

type Reference

type Reference struct {
	File    string
	Line    int
	Package string
	Name    string
}

Reference is one pkg.Identifier a doc sample names.

func ReferencesInDocs

func ReferencesInDocs(dir string) ([]Reference, error)

ReferencesInDocs extracts every pkg.Identifier selector from the Go fences of the .mdx files under dir, with the line it sits on.

Jump to

Keyboard shortcuts

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