debug

package
v1.7.1 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Cut

func Cut(s, sep []byte) (before, after []byte, found bool)

Types

type BuildInfo

type BuildInfo struct {
	GoVersion string         // Version of Go that produced this binary.
	Path      string         // The main package path
	Main      Module         // The module containing the main package
	Deps      []*Module      // Module dependencies
	Settings  []BuildSetting // Other information about the build.
}

BuildInfo represents the build information read from a Go binary.

func ReadBuildInfo

func ReadBuildInfo() (info *BuildInfo, ok bool)

ReadBuildInfo returns the build information embedded in the running binary. The information is available only in binaries built with module support.

func (*BuildInfo) MarshalText

func (bi *BuildInfo) MarshalText() ([]byte, error)

func (*BuildInfo) UnmarshalText

func (bi *BuildInfo) UnmarshalText(data []byte) (err error)

type BuildSetting

type BuildSetting struct {
	// Key and Value describe the build setting.
	// Key must not contain an equals sign, space, tab, or newline.
	// Value must not contain newlines ('\n').
	Key, Value string
}

BuildSetting describes a setting that may be used to understand how the binary was built. For example, VCS commit and dirty status is stored here.

type Module

type Module struct {
	Path    string  // module path
	Version string  // module version
	Sum     string  // checksum
	Replace *Module // replaced by this module
}

Module represents a module.

Jump to

Keyboard shortcuts

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