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

registry

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package registry owns the global language lookup tables and the shared path-convention rules. Drivers register themselves here; the facade (internal/lang) is what external consumers import.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ByID

func ByID(id types.ID) (types.Language, bool)

ByID returns the language registered under id.

func Classify

func Classify(path string) types.Classification

Classify applies shared conventions and then the language driver rules.

func ForPath

func ForPath(path string) (types.Language, bool)

ForPath resolves the language for a file by extension.

func Imports

func Imports(path, moduleRoot string, content []byte) []string

Imports returns the import targets referenced by a file, resolved to repo-relative path prefixes. The path's language driver owns the import syntax; paths with no registered ImportScanner contribute no fan-in.

func Register

func Register(l types.Language)

Register adds a language to the registry. Registering the same ID replaces the previous entry.

func ShouldSkipSmart

func ShouldSkipSmart(path, filename string, content []byte) (bool, string)

ShouldSkipSmart reports whether any registered language's smart rules skip the file. Every rule is applied to every path, so cross-language artifacts (e.g. package-lock.json) are still caught regardless of the file's own language, matching the historical flat rule list behavior.

Types

This section is empty.

Jump to

Keyboard shortcuts

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