...

Package packagepath

import "cmd/vendor/golang.org/x/tools/internal/packagepath"
Overview
Index

Overview ▾

Package packagepath provides metadata operations on package path strings.

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).