pkginit

package standard library
go1.18.8 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2022 License: BSD-3-Clause Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	InitNotStarted = iota
	InitDone
	InitPending
)

Static initialization phase. These values are stored in two bits in Node.flags.

Variables

This section is empty.

Functions

func MakeInit added in go1.18

func MakeInit()

MakeInit creates a synthetic init function to handle any package-scope initialization statements.

TODO(mdempsky): Move into noder, so that the types2-based frontends can use Info.InitOrder instead.

func Task

func Task() *ir.Name

Task makes and returns an initialization record for the package. See runtime/proc.go:initTask for its layout. The 3 tasks for initialization are:

  1. Initialize all of the packages the current package depends on.
  2. Initialize all the variables that have initializers.
  3. Run any init functions.

Types

type InitOrder

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

Jump to

Keyboard shortcuts

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