linkdeps

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Filename is the standard file name for link.deps files.
	Filename = "link.deps"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type LinkDeps

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

LinkDeps represents the contents of a Filename file. It lists all synthetic dependencies added by instrumentation into a Go object archive. These include the transitive closure of link-time dependencies, so that it is not necessary to perform a full traversal of transitive dependencies to consume. Link-time dependencies consist of new dependencies introduced to resolve go:linkname directives as well as new import-level directives that the Go toolchain is not normally aware of.

func FromArchive

func FromArchive(archive string) (res LinkDeps, err error)

FromArchive reads a Filename file from the provided Go archive file. Returns an empty LinkDeps if the archive does not contain a Filename file.

func FromImportConfig added in v1.0.0

func FromImportConfig(importcfg *importcfg.ImportConfig) (LinkDeps, error)

FromImportConfig aggregates entries from all Filename found in the archives listed in importcfg.ImportConfig.

func Read

func Read(r io.Reader) (l LinkDeps, err error)

Read reads a Filename file content from the provided io.Reader.

func ReadFile

func ReadFile(filename string) (LinkDeps, error)

ReadFile reads a Filename file from the provided filename.

func (*LinkDeps) Add

func (l *LinkDeps) Add(importPath string)

Add registers a new import path in this LinkDeps instance.

func (*LinkDeps) Contains added in v1.0.0

func (l *LinkDeps) Contains(importPath string) bool

Contains checks whether a given import path is already represented by this LinkDeps.

func (*LinkDeps) Dependencies

func (l *LinkDeps) Dependencies() []string

Dependencies returns all import paths registered in this LinkDeps instance.

func (*LinkDeps) Empty

func (l *LinkDeps) Empty() bool

Empty returns true if this LinkDeps instance is empty.

func (*LinkDeps) Len

func (l *LinkDeps) Len() int

Len returns the number of import paths registered in this LinkDeps instance.

func (*LinkDeps) Write

func (l *LinkDeps) Write(w io.Writer) error

Write writes this LinkDeps instance to the provided writer.

func (*LinkDeps) WriteFile

func (l *LinkDeps) WriteFile(filename string) error

WriteFile writes this LinkDeps instance to the provided filename.

Jump to

Keyboard shortcuts

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