packagescan

package
v0.4.4-alpha Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2025 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Overview

Package packagescan implements the front-end to the packagescan analysis.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DumpResultsByOS

func DumpResultsByOS(results map[string]map[string]bool)

DumpResultsByOS creates a tabular representation of the output, printing fixed size columns for the package's presence in each of the target OS's, followed by the name of the package name. We use the platform name rather than 'X' in case the list was long and any headers scrolled off. We could also have used the first letter of the platform as a mnemonic. results is a map from platform name to a set of packages that import the target on that platform

func FindImporters

func FindImporters(pkglist []*ssa.Package, target string, exact bool, rawfile io.WriteCloser) map[string]bool

FindImporters searches the list of packages (pkglist) for any imports of the target package or packages. If exact==true, it will compare the Name() of each imported package to the target. This is useful for packages like reflect and unsafe, where you only want exact matches. If exact==false, it will see if the Path() of each imported package begins with the target. This is useful for projects spanning multiple projects, such as github.com/aws/aws-sdk-go/

func Run

func Run(flags Flags) error

Run runs the packagescan analysis with flags.

Types

type Flags

type Flags struct {
	// contains filtered or unexported fields
}

Flags represents the parsed packagescan sub-command flags.

func NewFlags

func NewFlags(args []string) (Flags, error)

NewFlags returns the parsed flags from args.

Jump to

Keyboard shortcuts

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