package list

import "cmd/go/internal/list"

Package list implements the “go list” command.

Index

Variables

var CmdList = &base.Command{

	UsageLine: "go list [-f format] [-json] [-m] [list flags] [build flags] [packages]",
	Short:     "list packages or modules",
	Long:      "" /* 15491 byte string literal not displayed */,
}

Types

type Context

type Context struct {
	GOARCH        string   `json:",omitempty"` // target architecture
	GOOS          string   `json:",omitempty"` // target operating system
	GOROOT        string   `json:",omitempty"` // Go root
	GOPATH        string   `json:",omitempty"` // Go path
	CgoEnabled    bool     `json:",omitempty"` // whether cgo can be used
	UseAllFiles   bool     `json:",omitempty"` // use files regardless of //go:build lines, file names
	Compiler      string   `json:",omitempty"` // compiler to assume when computing target paths
	BuildTags     []string `json:",omitempty"` // build constraints to match in +build lines
	ToolTags      []string `json:",omitempty"` // toolchain-specific build constraints
	ReleaseTags   []string `json:",omitempty"` // releases the current release is compatible with
	InstallSuffix string   `json:",omitempty"` // suffix to use in the name of the install dir
}

type TrackingWriter

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

TrackingWriter tracks the last byte written on every write so we can avoid printing a newline if one was already written or if there is no output at all.

func (*TrackingWriter) Flush

func (t *TrackingWriter) Flush()

func (*TrackingWriter) NeedNL

func (t *TrackingWriter) NeedNL() bool

func (*TrackingWriter) Write

func (t *TrackingWriter) Write(p []byte) (n int, err error)

Source Files

context.go list.go

Version
v1.24.0 (latest)
Published
Feb 10, 2025
Platform
linux/amd64
Imports
25 packages
Last checked
21 minutes ago

Tools for package owners.