detect

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2026 License: MPL-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package detect identifies source languages from a filesystem using enry heuristics.

Index

Constants

This section is empty.

Variables

View Source
var ErrNoLanguageDetected = errors.New("no language detected")

ErrNoLanguageDetected is returned when enry cannot identify a file's language.

Functions

func Detect

func Detect(_ context.Context, dirFS fs.FS, path string) (string, error)

Detect returns the language of a single file at path within dirFS, or ErrNoLanguageDetected if none can be identified.

func Languages

func Languages(ctx context.Context, dirFS fs.FS) ([]string, error)

Languages walks the directory and returns the set of programming languages detected using enry. It samples file content for ambiguous extensions (e.g., .rs can be Rust or RenderScript).

Types

This section is empty.

Jump to

Keyboard shortcuts

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