stdlib

package
v0.31.0 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2025 License: BSD-3-Clause Imports: 5 Imported by: 0

Documentation

Overview

Package stdlib provides a table of all exported symbols in the standard library, along with the version at which they first appeared. It also provides the import graph of std packages.

Index

Constants

This section is empty.

Variables

View Source
var PackageSymbols = map[string][]Symbol{}/* 171 elements not displayed */

Functions

func Dependencies added in v0.31.0

func Dependencies(pkgs ...string) iter.Seq[string]

Dependencies returns the set of all dependencies of the named standard packages, including the initial package, in a deterministic topological order. The dependencies of an unknown package are the empty set.

The graph is built into the application and may differ from the graph in the Go source tree being analyzed by the application.

func HasPackage

func HasPackage(path string) bool

HasPackage reports whether the specified package path is part of the standard library's public API.

func Imports added in v0.31.0

func Imports(pkgs ...string) iter.Seq[string]

Imports returns the sequence of packages directly imported by the named standard packages, in name order. The imports of an unknown package are the empty set.

The graph is built into the application and may differ from the graph in the Go source tree being analyzed by the application.

Types

type Kind

type Kind int8

A Kind indicates the kind of a symbol: function, variable, constant, type, and so on.

const (
	Invalid Kind = iota // Example name:
	Type                // "Buffer"
	Func                // "Println"
	Var                 // "EOF"
	Const               // "Pi"
	Field               // "Point.X"
	Method              // "(*Buffer).Grow"
)

func (Kind) String

func (kind Kind) String() string

type Symbol

type Symbol struct {
	Name    string
	Kind    Kind
	Version Version // Go version that first included the symbol
}

func (*Symbol) SplitField

func (sym *Symbol) SplitField() (typename, name string)

SplitField splits the field symbol name into type and field components. It must be called only on Field symbols.

Example: "File.Package" -> ("File", "Package")

func (*Symbol) SplitMethod

func (sym *Symbol) SplitMethod() (ptr bool, recv, name string)

SplitMethod splits the method symbol name into pointer, receiver, and method components. It must be called only on Method symbols.

Example: "(*Buffer).Grow" -> (true, "Buffer", "Grow")

type Version

type Version int8

A Version represents a version of Go of the form "go1.%d".

func (Version) String

func (v Version) String() string

String returns a version string of the form "go1.23", without allocating.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳