// Copyright 2025 The Go Authors. All rights reserved.// Use of this source code is governed by a BSD-style// license that can be found in the LICENSE file.package stdlib// This file provides the API for the import graph of the standard library.//// Be aware that the compiler-generated code for every package// implicitly depends on package "runtime" and a handful of others// (see runtimePkgs in GOROOT/src/cmd/internal/objabi/pkgspecial.go).import ()// 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.func ( ...string) iter.Seq[string] {returnfunc( func(string) bool) {for , := range {if , := find(); {varuint64for := []byte(deps[].deps); len() > 0; { , := binary.Uvarint() += if !(deps[].name) {return } = [:] } } } }}// 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 ( ...string) iter.Seq[string] {returnfunc( func(string) bool) {for , := range {if , := find(); {var [1 + len(deps)/8]byte// bit set of seen packagesvarfunc( int) bool = func( int) bool { := byte(1) << ( % 8)if [/8]& == 0 { [/8] |= varuint64for := []byte(deps[].deps); len() > 0; { , := binary.Uvarint() += if !(int()) {returnfalse } = [:] }if !(deps[].name) {returnfalse } }returntrue }if !() {return } } } }}// find returns the index of pkg in the deps table.func ( string) (int, bool) {returnslices.BinarySearchFunc(deps[:], , func( pkginfo, string) int {returnstrings.Compare(.name, ) })}
The pages are generated with Goldsv0.7.6. (GOOS=linux GOARCH=amd64)