toolsgolang.org/x/tools/internal/packagepath Index | Files

package packagepath

import "golang.org/x/tools/internal/packagepath"

Package packagepath provides metadata operations on package path strings.

Index

Functions

func CanImport

func CanImport(from, to string) bool

CanImport reports whether one package is allowed to import another.

TODO(adonovan): allow customization of the accessibility relation (e.g. for Bazel).

func IsStdPackage

func IsStdPackage(path string) bool

IsStdPackage reports whether the specified package path belongs to a package in the standard library (including internal dependencies).

Source Files

packagepath.go

Version
v0.44.0 (latest)
Published
Apr 9, 2026
Platform
js/wasm
Imports
1 packages
Last checked
3 minutes ago

Tools for package owners.