astutil

package
v2.5.3 Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2022 License: MIT Imports: 5 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseBuildTag

func ParseBuildTag(f *ast.File) string

ParseBuildTag parse `//+build ...` or `//go:build ` on a first line of *ast.File

func UsesImport

func UsesImport(f *ast.File, packageImports PackageImports, importPath string) bool

UsesImport is for analyze if the import dependency is in use

Types

type PackageImports

type PackageImports map[string]string

PackageImports is map of imports with their package names

func LoadPackageDependencies

func LoadPackageDependencies(dir, buildTag string) (PackageImports, error)

LoadPackageDependencies will return all package's imports with it names:

key - package(ex.: github/pkg/errors), value - name(ex.: errors)

Jump to

Keyboard shortcuts

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