load

package
v0.0.0-...-3621051 Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package load provides package loading functionality using DST parsing.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PackageDST

func PackageDST(importPath string) ([]*dst.File, *token.FileSet, error)

PackageDST loads a package by import path and returns its DST files and FileSet. This is the shared implementation used by all PackageLoader implementations. Uses fast DST parsing with no type checking for better performance.

func ResolveLocalPackagePath

func ResolveLocalPackagePath(importPath string) string

ResolveLocalPackagePath checks if importPath refers to a local subdirectory package. For simple package names (no slashes), it checks if there's a local subdirectory with that name containing .go files. This handles cases where local packages shadow stdlib packages (e.g., a local "time" package shadowing stdlib "time").

Returns the absolute path to the local package directory if found, or the original importPath if it should be resolved normally.

Types

This section is empty.

Jump to

Keyboard shortcuts

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