gocompiler

package module
v0.9.2202 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2024 License: BSD-3-Clause Imports: 14 Imported by: 2

README

gocompiler

The Go compiler as a package

# go1.22.0
go get github.com/bir3/gocompiler@v0.9.2202

Example

package main

import (
	"fmt"
	"log"
	"os"

	"github.com/bir3/gocompiler"
)

var goCodeStr string = `
package main

import "fmt"

func main() {
	fmt.Println("This code was compiled standalone")
}
`

func main() {

	// the go toolchain is built into the executable and must be given a chance to run
	// => avoid side effects in init() and global variable initialization
	//    as they will occur multiple times during compilation
	if gocompiler.IsRunToolchainRequest() {
		gocompiler.RunToolchain()
		return
	}

	err := os.WriteFile("temp.go", []byte(goCodeStr), 0644)
	if err != nil {
		log.Fatal(err)
	}

	result, err := gocompiler.Run("go", "run", "temp.go")
	fmt.Fprintf(os.Stdout, "%s", result.Stdout)
	fmt.Fprintf(os.Stderr, "%s", result.Stderr)
	if err != nil {
		log.Fatal(err)
	}
	os.Remove("temp.go")
}

Standard library

The standard library is embedded and is extracted on first run to standard config location;

  • $HOME/.config/bir3-gocompiler (linux)
  • $HOME/Library/Application Support/bir3-gocompiler (mac)

Private Go build cache

To avoid interfering with the standard Go toolchain build cache, the package has a private Go build cache;

  • $HOME/.cache/bir3-gocompiler (linux)
  • $HOME/Library/Caches/bir3-gocompiler (mac)

Limitations

  • avoid side effects in init() and global variable initializations

Reason: Your executable will serve two purposes:

  • run your application
  • run the Go compiler toolchain via gocompiler.RunToolchain()

Side effects in init() and global variable initializations occur every time the executable is started.
The embedded Go toolchain will repeatedly start the executable during compilation to compile Go source code.
This means that global side effects like opening a http port, writing to a file or connecting to a database is likely to cause problems.

gocompiler as a package vs. the official Go toolchain

"github.com/bir3/gocompiler" official go toolchain
Download size 26 MB (gzip of executable) 62 MB (gzip tarfile)
Size on disk 91 MB 237 MB
Compile speed 12.9 sec 12.4 sec macbook M1, go build -a

Note that this package is only focused on compiling Go source code into an executable, while the official Go toolchain provides many more tools.

Acknowledgments

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Command

func Command(env []string, args ...string) (*exec.Cmd, error)

func GoVersion added in v0.2.196

func GoVersion() string

func IsRunToolchainRequest

func IsRunToolchainRequest() bool

func RunToolchain

func RunToolchain()

adding extra executables : 44 MB -> 51 MB

Types

type Info added in v0.5.208

type Info struct {
	GoVersion string
	CacheDir  string
	GOROOT    string
}

func GetInfo added in v0.5.208

func GetInfo() (Info, error)

type Result

type Result struct {
	Stdout string
	Stderr string
}

func Run

func Run(args ...string) (Result, error)

func RunWithEnv

func RunWithEnv(env []string, args ...string) (Result, error)

Directories

Path Synopsis
compress/fse
Package fse provides Finite State Entropy encoding and decoding.
Package fse provides Finite State Entropy encoding and decoding.
compress/huff0
This file contains the specialisation of Decoder.Decompress4X and Decoder.Decompress1X that use an asm implementation of thir main loops.
This file contains the specialisation of Decoder.Decompress4X and Decoder.Decompress1X that use an asm implementation of thir main loops.
compress/internal/cpuinfo
Package cpuinfo gives runtime info about the current CPU.
Package cpuinfo gives runtime info about the current CPU.
compress/internal/snapref
Package snapref implements the Snappy compression format.
Package snapref implements the Snappy compression format.
compress/zstd
Package zstd provides decompression of zstandard files.
Package zstd provides decompression of zstandard files.
src
cmd/asm
Asm, typically invoked as “go tool asm”, assembles the source file into an object file named for the basename of the argument source file with a .o suffix.
Asm, typically invoked as “go tool asm”, assembles the source file into an object file named for the basename of the argument source file with a .o suffix.
cmd/asm/flag
Package flag implements command-line flag parsing.
Package flag implements command-line flag parsing.
cmd/asm/internal/arch
Package arch defines architecture-specific information and support functions.
Package arch defines architecture-specific information and support functions.
cmd/asm/internal/asm
Package asm implements the parser and instruction generator for the assembler.
Package asm implements the parser and instruction generator for the assembler.
cmd/asm/internal/flags
Package flags implements top-level flags and the usage message for the assembler.
Package flags implements top-level flags and the usage message for the assembler.
cmd/asm/internal/lex
Package lex implements lexical analysis for the assembler.
Package lex implements lexical analysis for the assembler.
cmd/cgo
Cgo enables the creation of Go packages that call C code.
Cgo enables the creation of Go packages that call C code.
cmd/cgo/flag
Package flag implements command-line flag parsing.
Package flag implements command-line flag parsing.
cmd/cgo/internal/test
Test that pthread_cancel works as expected (NPTL uses SIGRTMIN to implement thread cancellation) See https://golang.org/issue/6997
Test that pthread_cancel works as expected (NPTL uses SIGRTMIN to implement thread cancellation) See https://golang.org/issue/6997
cmd/compile
Compile, typically invoked as “go tool compile,” compiles a single Go package comprising the files named on the command line.
Compile, typically invoked as “go tool compile,” compiles a single Go package comprising the files named on the command line.
cmd/compile/flag
Package flag implements command-line flag parsing.
Package flag implements command-line flag parsing.
cmd/compile/internal/compare
Package compare contains code for generating comparison routines for structs, strings and interfaces.
Package compare contains code for generating comparison routines for structs, strings and interfaces.
cmd/compile/internal/devirtualize
Package devirtualize implements two "devirtualization" optimization passes:
Package devirtualize implements two "devirtualization" optimization passes:
cmd/compile/internal/importer
package importer implements Import for gc-generated object files.
package importer implements Import for gc-generated object files.
cmd/compile/internal/inline/interleaved
Package interleaved implements the interleaved devirtualization and inlining pass.
Package interleaved implements the interleaved devirtualization and inlining pass.
cmd/compile/internal/loopvar
Package loopvar applies the proper variable capture, according to experiment, flags, language version, etc.
Package loopvar applies the proper variable capture, according to experiment, flags, language version, etc.
cmd/compile/internal/pgo/internal/graph
Package graph represents a pprof profile as a directed graph.
Package graph represents a pprof profile as a directed graph.
cmd/compile/internal/rangefunc
Package rangefunc rewrites range-over-func to code that doesn't use range-over-funcs.
Package rangefunc rewrites range-over-func to code that doesn't use range-over-funcs.
cmd/compile/internal/rttype
Package rttype allows the compiler to share type information with the runtime.
Package rttype allows the compiler to share type information with the runtime.
cmd/compile/internal/ssa/_gen
The gen command generates Go code (in the parent directory) for all the architecture-specific opcodes, blocks, and rewrites.
The gen command generates Go code (in the parent directory) for all the architecture-specific opcodes, blocks, and rewrites.
cmd/compile/internal/types2
Package types declares the data types and implements the algorithms for type-checking of Go packages.
Package types declares the data types and implements the algorithms for type-checking of Go packages.
cmd/gocmd
Go is a tool for managing Go source code.
Go is a tool for managing Go source code.
cmd/gocmd/flag
Package flag implements command-line flag parsing.
Package flag implements command-line flag parsing.
cmd/gocmd/internal/auth
Package auth provides access to user-provided authentication credentials.
Package auth provides access to user-provided authentication credentials.
cmd/gocmd/internal/base
Package base defines shared basic pieces of the go command, in particular logging and the Command structure.
Package base defines shared basic pieces of the go command, in particular logging and the Command structure.
cmd/gocmd/internal/bug
Package bug implements the “go bug” command.
Package bug implements the “go bug” command.
cmd/gocmd/internal/cache
Package cache implements a build artifact cache.
Package cache implements a build artifact cache.
cmd/gocmd/internal/cfg
Package cfg holds configuration shared by multiple parts of the go command.
Package cfg holds configuration shared by multiple parts of the go command.
cmd/gocmd/internal/clean
Package clean implements the “go clean” command.
Package clean implements the “go clean” command.
cmd/gocmd/internal/cmdflag
Package cmdflag handles flag processing common to several go tools.
Package cmdflag handles flag processing common to several go tools.
cmd/gocmd/internal/doc
Package doc implements the “go doc” command.
Package doc implements the “go doc” command.
cmd/gocmd/internal/envcmd
Package envcmd implements the “go env” command.
Package envcmd implements the “go env” command.
cmd/gocmd/internal/fix
Package fix implements the “go fix” command.
Package fix implements the “go fix” command.
cmd/gocmd/internal/fmtcmd
Package fmtcmd implements the “go fmt” command.
Package fmtcmd implements the “go fmt” command.
cmd/gocmd/internal/fsys
Package fsys is an abstraction for reading files that allows for virtual overlays on top of the files on disk.
Package fsys is an abstraction for reading files that allows for virtual overlays on top of the files on disk.
cmd/gocmd/internal/generate
Package generate implements the “go generate” command.
Package generate implements the “go generate” command.
cmd/gocmd/internal/gover
Package gover implements support for Go toolchain versions like 1.21.0 and 1.21rc1.
Package gover implements support for Go toolchain versions like 1.21.0 and 1.21rc1.
cmd/gocmd/internal/help
Package help implements the “go help” command.
Package help implements the “go help” command.
cmd/gocmd/internal/list
Package list implements the “go list” command.
Package list implements the “go list” command.
cmd/gocmd/internal/load
Package load loads packages.
Package load loads packages.
cmd/gocmd/internal/lockedfile
Package lockedfile creates and manipulates files whose contents should only change atomically.
Package lockedfile creates and manipulates files whose contents should only change atomically.
cmd/gocmd/internal/lockedfile/internal/filelock
Package filelock provides a platform-independent API for advisory file locking.
Package filelock provides a platform-independent API for advisory file locking.
cmd/gocmd/internal/mmap
The mmap package provides an abstraction for memory mapping files on different platforms.
The mmap package provides an abstraction for memory mapping files on different platforms.
cmd/gocmd/internal/modcmd
Package modcmd implements the “go mod” command.
Package modcmd implements the “go mod” command.
cmd/gocmd/internal/modfetch/codehost
Package codehost defines the interface implemented by a code hosting source, along with support code for use by implementations.
Package codehost defines the interface implemented by a code hosting source, along with support code for use by implementations.
cmd/gocmd/internal/modget
Package modget implements the module-aware “go get” command.
Package modget implements the module-aware “go get” command.
cmd/gocmd/internal/mvs
Package mvs implements Minimal Version Selection.
Package mvs implements Minimal Version Selection.
cmd/gocmd/internal/par
Package par implements parallel execution helpers.
Package par implements parallel execution helpers.
cmd/gocmd/internal/robustio
Package robustio wraps I/O functions that are prone to failure on Windows, transparently retrying errors up to an arbitrary timeout.
Package robustio wraps I/O functions that are prone to failure on Windows, transparently retrying errors up to an arbitrary timeout.
cmd/gocmd/internal/run
Package run implements the “go run” command.
Package run implements the “go run” command.
cmd/gocmd/internal/script
Package script implements a small, customizable, platform-agnostic scripting language.
Package script implements a small, customizable, platform-agnostic scripting language.
cmd/gocmd/internal/script/scripttest
Package scripttest adapts the script engine for use in tests.
Package scripttest adapts the script engine for use in tests.
cmd/gocmd/internal/str
Package str provides string manipulation utilities.
Package str provides string manipulation utilities.
cmd/gocmd/internal/tool
Package tool implements the “go tool” command.
Package tool implements the “go tool” command.
cmd/gocmd/internal/toolchain
Package toolchain implements dynamic switching of Go toolchains.
Package toolchain implements dynamic switching of Go toolchains.
cmd/gocmd/internal/vcweb
Package vcweb serves version control repos for testing the go command.
Package vcweb serves version control repos for testing the go command.
cmd/gocmd/internal/vcweb/vcstest
Package vcstest serves the repository scripts in cmd/go/testdata/vcstest using the [vcweb] script engine.
Package vcstest serves the repository scripts in cmd/go/testdata/vcstest using the [vcweb] script engine.
cmd/gocmd/internal/version
Package version implements the “go version” command.
Package version implements the “go version” command.
cmd/gocmd/internal/vet
Package vet implements the “go vet” command.
Package vet implements the “go vet” command.
cmd/gocmd/internal/web
Package web defines minimal helper routines for accessing HTTP/HTTPS resources without requiring external dependencies on the net package.
Package web defines minimal helper routines for accessing HTTP/HTTPS resources without requiring external dependencies on the net package.
cmd/gocmd/internal/workcmd
Package workcmd implements the “go work” command.
Package workcmd implements the “go work” command.
cmd/gofmt
Gofmt formats Go programs.
Gofmt formats Go programs.
cmd/gofmt/flag
Package flag implements command-line flag parsing.
Package flag implements command-line flag parsing.
cmd/internal/archive
Package archive implements reading of archive files generated by the Go toolchain.
Package archive implements reading of archive files generated by the Go toolchain.
cmd/internal/bio
Package bio implements common I/O abstractions used within the Go toolchain.
Package bio implements common I/O abstractions used within the Go toolchain.
cmd/internal/browser
Package browser provides utilities for interacting with users' browsers.
Package browser provides utilities for interacting with users' browsers.
cmd/internal/codesign
Package codesign provides basic functionalities for ad-hoc code signing of Mach-O files.
Package codesign provides basic functionalities for ad-hoc code signing of Mach-O files.
cmd/internal/dwarf
Package dwarf generates DWARF debugging information.
Package dwarf generates DWARF debugging information.
cmd/internal/edit
Package edit implements buffered position-based editing of byte slices.
Package edit implements buffered position-based editing of byte slices.
cmd/internal/gcprog
Package gcprog implements an encoder for packed GC pointer bitmaps, known as GC programs.
Package gcprog implements an encoder for packed GC pointer bitmaps, known as GC programs.
cmd/internal/notsha256
Package notsha256 implements the NOTSHA256 algorithm, a hash defined as bitwise NOT of SHA256.
Package notsha256 implements the NOTSHA256 algorithm, a hash defined as bitwise NOT of SHA256.
cmd/internal/obj/arm64
Package arm64 implements an ARM64 assembler.
Package arm64 implements an ARM64 assembler.
cmd/internal/obj/ppc64
Package ppc64 implements a PPC64 assembler that assembles Go asm into the corresponding PPC64 instructions as defined by the Power ISA 3.0B.
Package ppc64 implements a PPC64 assembler that assembles Go asm into the corresponding PPC64 instructions as defined by the Power ISA 3.0B.
cmd/internal/obj/riscv
Code generated by parse.py -go rv64_a rv64_d rv64_f rv64_i rv64_m rv64_q rv_a rv_d rv_f rv_i rv_m rv_q rv_s rv_system rv_zicsr; DO NOT EDIT.
Code generated by parse.py -go rv64_a rv64_d rv64_f rv64_i rv64_m rv64_q rv_a rv_d rv_f rv_i rv_m rv_q rv_s rv_system rv_zicsr; DO NOT EDIT.
cmd/internal/objfile
Package objfile implements portable access to OS-specific executable files.
Package objfile implements portable access to OS-specific executable files.
cmd/internal/osinfo
Package osinfo provides OS metadata.
Package osinfo provides OS metadata.
cmd/internal/pkgpath
Package pkgpath determines the package path used by gccgo/GoLLVM symbols.
Package pkgpath determines the package path used by gccgo/GoLLVM symbols.
cmd/internal/quoted
Package quoted provides string manipulation utilities.
Package quoted provides string manipulation utilities.
cmd/internal/test2json
Package test2json implements conversion of test binary output to JSON.
Package test2json implements conversion of test binary output to JSON.
cmd/link
Link, typically invoked as “go tool link”, reads the Go archive or object for a package link, along with its dependencies, and combines them into an executable binary.
Link, typically invoked as “go tool link”, reads the Go archive or object for a package link, along with its dependencies, and combines them into an executable binary.
cmd/link/flag
Package flag implements command-line flag parsing.
Package flag implements command-line flag parsing.
cmd/link/internal/benchmark
Package benchmark provides a Metrics object that enables memory and CPU profiling for the linker.
Package benchmark provides a Metrics object that enables memory and CPU profiling for the linker.
cmd/link/internal/loadelf
Package loadelf implements an ELF file reader.
Package loadelf implements an ELF file reader.
cmd/link/internal/loadmacho
Package loadmacho implements a Mach-O file reader.
Package loadmacho implements a Mach-O file reader.
cmd/link/internal/loadpe
Package loadpe implements a PE/COFF file reader.
Package loadpe implements a PE/COFF file reader.
cmd/link/internal/loadxcoff
Package loadxcoff implements a XCOFF file reader.
Package loadxcoff implements a XCOFF file reader.
debug/buildinfo
Package buildinfo provides access to information embedded in a Go binary about how it was built.
Package buildinfo provides access to information embedded in a Go binary about how it was built.
debug/dwarf
Package dwarf provides access to DWARF debugging information loaded from executable files, as defined in the DWARF 2.0 Standard at http://dwarfstd.org/doc/dwarf-2.0.0.pdf.
Package dwarf provides access to DWARF debugging information loaded from executable files, as defined in the DWARF 2.0 Standard at http://dwarfstd.org/doc/dwarf-2.0.0.pdf.
debug/elf
Package elf implements access to ELF object files.
Package elf implements access to ELF object files.
debug/gosym
Package gosym implements access to the Go symbol and line number tables embedded in Go binaries generated by the gc compilers.
Package gosym implements access to the Go symbol and line number tables embedded in Go binaries generated by the gc compilers.
debug/macho
Package macho implements access to Mach-O object files.
Package macho implements access to Mach-O object files.
debug/pe
Package pe implements access to PE (Microsoft Windows Portable Executable) files.
Package pe implements access to PE (Microsoft Windows Portable Executable) files.
debug/plan9obj
Package plan9obj implements access to Plan 9 a.out object files.
Package plan9obj implements access to Plan 9 a.out object files.
go/ast
Package ast declares the types used to represent syntax trees for Go packages.
Package ast declares the types used to represent syntax trees for Go packages.
go/build
Package build gathers information about Go packages.
Package build gathers information about Go packages.
go/build/constraint
Package constraint implements parsing and evaluation of build constraint lines.
Package constraint implements parsing and evaluation of build constraint lines.
go/constant
Package constant implements Values representing untyped Go constants and their corresponding operations.
Package constant implements Values representing untyped Go constants and their corresponding operations.
go/doc
Package doc extracts source code documentation from a Go AST.
Package doc extracts source code documentation from a Go AST.
go/doc/comment
Package comment implements parsing and reformatting of Go doc comments, (documentation comments), which are comments that immediately precede a top-level declaration of a package, const, func, type, or var.
Package comment implements parsing and reformatting of Go doc comments, (documentation comments), which are comments that immediately precede a top-level declaration of a package, const, func, type, or var.
go/format
Package format implements standard formatting of Go source.
Package format implements standard formatting of Go source.
go/importer
Package importer provides access to export data importers.
Package importer provides access to export data importers.
go/internal/gccgoimporter
Package gccgoimporter implements Import for gccgo-generated object files.
Package gccgoimporter implements Import for gccgo-generated object files.
go/internal/gcimporter
Package gcimporter implements Import for gc-generated object files.
Package gcimporter implements Import for gc-generated object files.
go/internal/srcimporter
Package srcimporter implements importing directly from source files rather than installed packages.
Package srcimporter implements importing directly from source files rather than installed packages.
go/parser
Package parser implements a parser for Go source files.
Package parser implements a parser for Go source files.
go/printer
Package printer implements printing of AST nodes.
Package printer implements printing of AST nodes.
go/scanner
Package scanner implements a scanner for Go source text.
Package scanner implements a scanner for Go source text.
go/token
Package token defines constants representing the lexical tokens of the Go programming language and basic operations on tokens (printing, predicates).
Package token defines constants representing the lexical tokens of the Go programming language and basic operations on tokens (printing, predicates).
go/types
Package types declares the data types and implements the algorithms for type-checking of Go packages.
Package types declares the data types and implements the algorithms for type-checking of Go packages.
go/version
Package version provides operations on [Go versions] in [Go toolchain name syntax]: strings like "go1.20", "go1.21.0", "go1.22rc2", and "go1.23.4-bigcorp".
Package version provides operations on [Go versions] in [Go toolchain name syntax]: strings like "go1.20", "go1.21.0", "go1.22rc2", and "go1.23.4-bigcorp".
internal/bisect
Package bisect can be used by compilers and other programs to serve as a target for the bisect debugging tool.
Package bisect can be used by compilers and other programs to serve as a target for the bisect debugging tool.
internal/buildcfg
Package buildcfg provides access to the build configuration described by the current environment.
Package buildcfg provides access to the build configuration described by the current environment.
internal/cfg
Package cfg holds configuration shared by the Go command and internal/testenv.
Package cfg holds configuration shared by the Go command and internal/testenv.
internal/chacha8rand
Package chacha8rand implements a pseudorandom generator based on ChaCha8.
Package chacha8rand implements a pseudorandom generator based on ChaCha8.
internal/cpu
Package cpu implements processor feature detection used by the Go standard library.
Package cpu implements processor feature detection used by the Go standard library.
internal/dag
Package dag implements a language for expressing directed acyclic graphs.
Package dag implements a language for expressing directed acyclic graphs.
internal/fmtsort
Package fmtsort provides a general stable ordering mechanism for maps, on behalf of the fmt and text/template packages.
Package fmtsort provides a general stable ordering mechanism for maps, on behalf of the fmt and text/template packages.
internal/fuzz
Package fuzz provides common fuzzing functionality for tests built with "go test" and for programs that use fuzzing functionality in the testing package.
Package fuzz provides common fuzzing functionality for tests built with "go test" and for programs that use fuzzing functionality in the testing package.
internal/goarch
package goarch contains GOARCH-specific constants.
package goarch contains GOARCH-specific constants.
internal/godebug
Package godebug makes the settings in the $GODEBUG environment variable available to other packages.
Package godebug makes the settings in the $GODEBUG environment variable available to other packages.
internal/godebugs
Package godebugs provides a table of known GODEBUG settings, for use by a variety of other packages, including internal/godebug, runtime, runtime/metrics, and cmd/go/internal/load.
Package godebugs provides a table of known GODEBUG settings, for use by a variety of other packages, including internal/godebug, runtime, runtime/metrics, and cmd/go/internal/load.
internal/goexperiment
Package goexperiment implements support for toolchain experiments.
Package goexperiment implements support for toolchain experiments.
internal/goos
package goos contains GOOS-specific constants.
package goos contains GOOS-specific constants.
internal/gover
Package gover implements support for Go toolchain versions like 1.21.0 and 1.21rc1.
Package gover implements support for Go toolchain versions like 1.21.0 and 1.21rc1.
internal/intern
Package intern lets you make smaller comparable values by boxing a larger comparable value (such as a 16 byte string header) down into a globally unique 8 byte pointer.
Package intern lets you make smaller comparable values by boxing a larger comparable value (such as a 16 byte string header) down into a globally unique 8 byte pointer.
internal/lazyregexp
Package lazyregexp is a thin wrapper over regexp, allowing the use of global regexp variables without forcing them to be compiled at init.
Package lazyregexp is a thin wrapper over regexp, allowing the use of global regexp variables without forcing them to be compiled at init.
internal/lazytemplate
Package lazytemplate is a thin wrapper over text/template, allowing the use of global template variables without forcing them to be parsed at init.
Package lazytemplate is a thin wrapper over text/template, allowing the use of global template variables without forcing them to be parsed at init.
internal/nettrace
Package nettrace contains internal hooks for tracing activity in the net package.
Package nettrace contains internal hooks for tracing activity in the net package.
internal/obscuretestdata
Package obscuretestdata contains functionality used by tests to more easily work with testdata that must be obscured primarily due to golang.org/issue/34986.
Package obscuretestdata contains functionality used by tests to more easily work with testdata that must be obscured primarily due to golang.org/issue/34986.
internal/oserror
Package oserror defines errors values used in the os package.
Package oserror defines errors values used in the os package.
internal/pkgbits
Package pkgbits implements low-level coding abstractions for Unified IR's export data format.
Package pkgbits implements low-level coding abstractions for Unified IR's export data format.
internal/poll
Package poll supports non-blocking I/O on file descriptors with polling.
Package poll supports non-blocking I/O on file descriptors with polling.
internal/profile
Package profile provides a representation of github.com/google/pprof/proto/profile.proto and methods to encode/decode/merge profiles in this format.
Package profile provides a representation of github.com/google/pprof/proto/profile.proto and methods to encode/decode/merge profiles in this format.
internal/race
Package race contains helper functions for manually instrumenting code for the race detector.
Package race contains helper functions for manually instrumenting code for the race detector.
internal/reflectlite
Package reflectlite implements lightweight version of reflect, not using any package except for "runtime", "unsafe", and "internal/abi"
Package reflectlite implements lightweight version of reflect, not using any package except for "runtime", "unsafe", and "internal/abi"
internal/safefilepath
Package safefilepath manipulates operating-system file paths.
Package safefilepath manipulates operating-system file paths.
internal/saferio
Package saferio provides I/O functions that avoid allocating large amounts of memory unnecessarily.
Package saferio provides I/O functions that avoid allocating large amounts of memory unnecessarily.
internal/singleflight
Package singleflight provides a duplicate function call suppression mechanism.
Package singleflight provides a duplicate function call suppression mechanism.
internal/syscall/windows/registry
Package registry provides access to the Windows registry.
Package registry provides access to the Windows registry.
internal/syscall/windows/sysdll
Package sysdll is an internal leaf package that records and reports which Windows DLL names are used by Go itself.
Package sysdll is an internal leaf package that records and reports which Windows DLL names are used by Go itself.
internal/sysinfo
Package sysinfo implements high level hardware information gathering that can be used for debugging or information purposes.
Package sysinfo implements high level hardware information gathering that can be used for debugging or information purposes.
internal/testenv
Package testenv provides information about what functionality is available in different testing environments run by the Go team.
Package testenv provides information about what functionality is available in different testing environments run by the Go team.
internal/testlog
Package testlog provides a back-channel communication path between tests and package os, so that cmd/go can see which environment variables and files a test consults.
Package testlog provides a back-channel communication path between tests and package os, so that cmd/go can see which environment variables and files a test consults.
internal/testpty
Package testpty is a simple pseudo-terminal package for Unix systems, implemented by calling C functions via cgo.
Package testpty is a simple pseudo-terminal package for Unix systems, implemented by calling C functions via cgo.
internal/trace/traceviewer/format
Package traceviewer provides definitions of the JSON data structures used by the Chrome trace viewer.
Package traceviewer provides definitions of the JSON data structures used by the Chrome trace viewer.
internal/trace/v2/raw
Package raw provides an interface to interpret and emit Go execution traces.
Package raw provides an interface to interpret and emit Go execution traces.
internal/txtar
Package txtar implements a trivial text-based file archive format.
Package txtar implements a trivial text-based file archive format.
internal/unsafeheader
Package unsafeheader contains header declarations for the Go runtime's slice and string implementations.
Package unsafeheader contains header declarations for the Go runtime's slice and string implementations.
internal/xcoff
Package xcoff implements access to XCOFF (Extended Common Object File Format) files.
Package xcoff implements access to XCOFF (Extended Common Object File Format) files.
internal/zstd
Package zstd provides a decompressor for zstd streams, described in RFC 8878.
Package zstd provides a decompressor for zstd streams, described in RFC 8878.
xvendor/github.com/google/pprof/driver
Package driver provides an external entry point to the pprof driver.
Package driver provides an external entry point to the pprof driver.
xvendor/github.com/google/pprof/internal/binutils
Package binutils provides access to the GNU binutils.
Package binutils provides access to the GNU binutils.
xvendor/github.com/google/pprof/internal/driver
Package driver implements the core pprof functionality.
Package driver implements the core pprof functionality.
xvendor/github.com/google/pprof/internal/elfexec
Package elfexec provides utility routines to examine ELF binaries.
Package elfexec provides utility routines to examine ELF binaries.
xvendor/github.com/google/pprof/internal/graph
Package graph collects a set of samples into a directed graph.
Package graph collects a set of samples into a directed graph.
xvendor/github.com/google/pprof/internal/measurement
Package measurement export utility functions to manipulate/format performance profile sample values.
Package measurement export utility functions to manipulate/format performance profile sample values.
xvendor/github.com/google/pprof/internal/plugin
Package plugin defines the plugin implementations that the main pprof driver requires.
Package plugin defines the plugin implementations that the main pprof driver requires.
xvendor/github.com/google/pprof/internal/report
Package report summarizes a performance profile into a human-readable report.
Package report summarizes a performance profile into a human-readable report.
xvendor/github.com/google/pprof/internal/symbolizer
Package symbolizer provides a routine to populate a profile with symbol, file and line number information.
Package symbolizer provides a routine to populate a profile with symbol, file and line number information.
xvendor/github.com/google/pprof/internal/symbolz
Package symbolz symbolizes a profile using the output from the symbolz service.
Package symbolz symbolizes a profile using the output from the symbolz service.
xvendor/github.com/google/pprof/internal/transport
Package transport provides a mechanism to send requests with https cert, key, and CA.
Package transport provides a mechanism to send requests with https cert, key, and CA.
xvendor/github.com/google/pprof/profile
Package profile provides a representation of profile.proto and methods to encode/decode profiles in this format.
Package profile provides a representation of profile.proto and methods to encode/decode profiles in this format.
xvendor/github.com/ianlancetaylor/demangle
Package demangle defines functions that demangle GCC/LLVM C++ and Rust symbol names.
Package demangle defines functions that demangle GCC/LLVM C++ and Rust symbol names.
xvendor/golang.org/x/arch/ppc64/ppc64asm
Package ppc64asm implements decoding of 64-bit PowerPC machine code.
Package ppc64asm implements decoding of 64-bit PowerPC machine code.
xvendor/golang.org/x/arch/x86/x86asm
Package x86asm implements decoding of x86 machine code.
Package x86asm implements decoding of x86 machine code.
xvendor/golang.org/x/mod/internal/lazyregexp
Package lazyregexp is a thin wrapper over regexp, allowing the use of global regexp variables without forcing them to be compiled at init.
Package lazyregexp is a thin wrapper over regexp, allowing the use of global regexp variables without forcing them to be compiled at init.
xvendor/golang.org/x/mod/modfile
Package modfile implements a parser and formatter for go.mod files.
Package modfile implements a parser and formatter for go.mod files.
xvendor/golang.org/x/mod/module
Package module defines the module.Version type along with support code.
Package module defines the module.Version type along with support code.
xvendor/golang.org/x/mod/semver
Package semver implements comparison of semantic version strings.
Package semver implements comparison of semantic version strings.
xvendor/golang.org/x/mod/sumdb
Package sumdb implements the HTTP protocols for serving or accessing a module checksum database.
Package sumdb implements the HTTP protocols for serving or accessing a module checksum database.
xvendor/golang.org/x/mod/sumdb/dirhash
Package dirhash defines hashes over directory trees.
Package dirhash defines hashes over directory trees.
xvendor/golang.org/x/mod/sumdb/note
Package note defines the notes signed by the Go module database server.
Package note defines the notes signed by the Go module database server.
xvendor/golang.org/x/mod/sumdb/tlog
Package tlog implements a tamper-evident log used in the Go module go.sum database server.
Package tlog implements a tamper-evident log used in the Go module go.sum database server.
xvendor/golang.org/x/mod/zip
Package zip provides functions for creating and extracting module zip files.
Package zip provides functions for creating and extracting module zip files.
xvendor/golang.org/x/sync/semaphore
Package semaphore provides a weighted semaphore implementation.
Package semaphore provides a weighted semaphore implementation.
xvendor/golang.org/x/sys/unix
Package unix contains an interface to the low-level operating system primitives.
Package unix contains an interface to the low-level operating system primitives.
xvendor/golang.org/x/sys/windows
Package windows contains an interface to the low-level operating system primitives.
Package windows contains an interface to the low-level operating system primitives.
xvendor/golang.org/x/term
Package term provides support functions for dealing with terminals, as commonly found on UNIX systems.
Package term provides support functions for dealing with terminals, as commonly found on UNIX systems.
xvendor/golang.org/x/tools/cmd/bisect
Bisect finds changes responsible for causing a failure.
Bisect finds changes responsible for causing a failure.
xvendor/golang.org/x/tools/cover
Package cover provides support for parsing coverage profiles generated by "go test -coverprofile=cover.out".
Package cover provides support for parsing coverage profiles generated by "go test -coverprofile=cover.out".
xvendor/golang.org/x/tools/go/analysis
Package analysis defines the interface between a modular static analysis and an analysis driver program.
Package analysis defines the interface between a modular static analysis and an analysis driver program.
xvendor/golang.org/x/tools/go/analysis/internal/analysisflags
Package analysisflags defines helpers for processing flags of analysis driver tools.
Package analysisflags defines helpers for processing flags of analysis driver tools.
xvendor/golang.org/x/tools/go/analysis/passes/appends
Package appends defines an Analyzer that detects if there is only one variable in append.
Package appends defines an Analyzer that detects if there is only one variable in append.
xvendor/golang.org/x/tools/go/analysis/passes/asmdecl
Package asmdecl defines an Analyzer that reports mismatches between assembly files and Go declarations.
Package asmdecl defines an Analyzer that reports mismatches between assembly files and Go declarations.
xvendor/golang.org/x/tools/go/analysis/passes/assign
Package assign defines an Analyzer that detects useless assignments.
Package assign defines an Analyzer that detects useless assignments.
xvendor/golang.org/x/tools/go/analysis/passes/atomic
Package atomic defines an Analyzer that checks for common mistakes using the sync/atomic package.
Package atomic defines an Analyzer that checks for common mistakes using the sync/atomic package.
xvendor/golang.org/x/tools/go/analysis/passes/bools
Package bools defines an Analyzer that detects common mistakes involving boolean operators.
Package bools defines an Analyzer that detects common mistakes involving boolean operators.
xvendor/golang.org/x/tools/go/analysis/passes/buildtag
Package buildtag defines an Analyzer that checks build tags.
Package buildtag defines an Analyzer that checks build tags.
xvendor/golang.org/x/tools/go/analysis/passes/cgocall
Package cgocall defines an Analyzer that detects some violations of the cgo pointer passing rules.
Package cgocall defines an Analyzer that detects some violations of the cgo pointer passing rules.
xvendor/golang.org/x/tools/go/analysis/passes/composite
Package composite defines an Analyzer that checks for unkeyed composite literals.
Package composite defines an Analyzer that checks for unkeyed composite literals.
xvendor/golang.org/x/tools/go/analysis/passes/copylock
Package copylock defines an Analyzer that checks for locks erroneously passed by value.
Package copylock defines an Analyzer that checks for locks erroneously passed by value.
xvendor/golang.org/x/tools/go/analysis/passes/ctrlflow
Package ctrlflow is an analysis that provides a syntactic control-flow graph (CFG) for the body of a function.
Package ctrlflow is an analysis that provides a syntactic control-flow graph (CFG) for the body of a function.
xvendor/golang.org/x/tools/go/analysis/passes/defers
Package defers defines an Analyzer that checks for common mistakes in defer statements.
Package defers defines an Analyzer that checks for common mistakes in defer statements.
xvendor/golang.org/x/tools/go/analysis/passes/directive
Package directive defines an Analyzer that checks known Go toolchain directives.
Package directive defines an Analyzer that checks known Go toolchain directives.
xvendor/golang.org/x/tools/go/analysis/passes/errorsas
The errorsas package defines an Analyzer that checks that the second argument to errors.As is a pointer to a type implementing error.
The errorsas package defines an Analyzer that checks that the second argument to errors.As is a pointer to a type implementing error.
xvendor/golang.org/x/tools/go/analysis/passes/framepointer
Package framepointer defines an Analyzer that reports assembly code that clobbers the frame pointer before saving it.
Package framepointer defines an Analyzer that reports assembly code that clobbers the frame pointer before saving it.
xvendor/golang.org/x/tools/go/analysis/passes/httpresponse
Package httpresponse defines an Analyzer that checks for mistakes using HTTP responses.
Package httpresponse defines an Analyzer that checks for mistakes using HTTP responses.
xvendor/golang.org/x/tools/go/analysis/passes/ifaceassert
Package ifaceassert defines an Analyzer that flags impossible interface-interface type assertions.
Package ifaceassert defines an Analyzer that flags impossible interface-interface type assertions.
xvendor/golang.org/x/tools/go/analysis/passes/inspect
Package inspect defines an Analyzer that provides an AST inspector (golang.org/x/tools/go/ast/inspector.Inspector) for the syntax trees of a package.
Package inspect defines an Analyzer that provides an AST inspector (golang.org/x/tools/go/ast/inspector.Inspector) for the syntax trees of a package.
xvendor/golang.org/x/tools/go/analysis/passes/internal/analysisutil
Package analysisutil defines various helper functions used by two or more packages beneath go/analysis.
Package analysisutil defines various helper functions used by two or more packages beneath go/analysis.
xvendor/golang.org/x/tools/go/analysis/passes/loopclosure
Package loopclosure defines an Analyzer that checks for references to enclosing loop variables from within nested functions.
Package loopclosure defines an Analyzer that checks for references to enclosing loop variables from within nested functions.
xvendor/golang.org/x/tools/go/analysis/passes/lostcancel
Package lostcancel defines an Analyzer that checks for failure to call a context cancellation function.
Package lostcancel defines an Analyzer that checks for failure to call a context cancellation function.
xvendor/golang.org/x/tools/go/analysis/passes/nilfunc
Package nilfunc defines an Analyzer that checks for useless comparisons against nil.
Package nilfunc defines an Analyzer that checks for useless comparisons against nil.
xvendor/golang.org/x/tools/go/analysis/passes/printf
Package printf defines an Analyzer that checks consistency of Printf format strings and arguments.
Package printf defines an Analyzer that checks consistency of Printf format strings and arguments.
xvendor/golang.org/x/tools/go/analysis/passes/shift
Package shift defines an Analyzer that checks for shifts that exceed the width of an integer.
Package shift defines an Analyzer that checks for shifts that exceed the width of an integer.
xvendor/golang.org/x/tools/go/analysis/passes/sigchanyzer
Package sigchanyzer defines an Analyzer that detects misuse of unbuffered signal as argument to signal.Notify.
Package sigchanyzer defines an Analyzer that detects misuse of unbuffered signal as argument to signal.Notify.
xvendor/golang.org/x/tools/go/analysis/passes/slog
Package slog defines an Analyzer that checks for mismatched key-value pairs in log/slog calls.
Package slog defines an Analyzer that checks for mismatched key-value pairs in log/slog calls.
xvendor/golang.org/x/tools/go/analysis/passes/stdmethods
Package stdmethods defines an Analyzer that checks for misspellings in the signatures of methods similar to well-known interfaces.
Package stdmethods defines an Analyzer that checks for misspellings in the signatures of methods similar to well-known interfaces.
xvendor/golang.org/x/tools/go/analysis/passes/stringintconv
Package stringintconv defines an Analyzer that flags type conversions from integers to strings.
Package stringintconv defines an Analyzer that flags type conversions from integers to strings.
xvendor/golang.org/x/tools/go/analysis/passes/structtag
Package structtag defines an Analyzer that checks struct field tags are well formed.
Package structtag defines an Analyzer that checks struct field tags are well formed.
xvendor/golang.org/x/tools/go/analysis/passes/testinggoroutine
Package testinggoroutine defines an Analyzerfor detecting calls to Fatal from a test goroutine.
Package testinggoroutine defines an Analyzerfor detecting calls to Fatal from a test goroutine.
xvendor/golang.org/x/tools/go/analysis/passes/tests
Package tests defines an Analyzer that checks for common mistaken usages of tests and examples.
Package tests defines an Analyzer that checks for common mistaken usages of tests and examples.
xvendor/golang.org/x/tools/go/analysis/passes/timeformat
Package timeformat defines an Analyzer that checks for the use of time.Format or time.Parse calls with a bad format.
Package timeformat defines an Analyzer that checks for the use of time.Format or time.Parse calls with a bad format.
xvendor/golang.org/x/tools/go/analysis/passes/unmarshal
The unmarshal package defines an Analyzer that checks for passing non-pointer or non-interface types to unmarshal and decode functions.
The unmarshal package defines an Analyzer that checks for passing non-pointer or non-interface types to unmarshal and decode functions.
xvendor/golang.org/x/tools/go/analysis/passes/unreachable
Package unreachable defines an Analyzer that checks for unreachable code.
Package unreachable defines an Analyzer that checks for unreachable code.
xvendor/golang.org/x/tools/go/analysis/passes/unsafeptr
Package unsafeptr defines an Analyzer that checks for invalid conversions of uintptr to unsafe.Pointer.
Package unsafeptr defines an Analyzer that checks for invalid conversions of uintptr to unsafe.Pointer.
xvendor/golang.org/x/tools/go/analysis/passes/unusedresult
Package unusedresult defines an analyzer that checks for unused results of calls to certain pure functions.
Package unusedresult defines an analyzer that checks for unused results of calls to certain pure functions.
xvendor/golang.org/x/tools/go/analysis/unitchecker
The unitchecker package defines the main function for an analysis driver that analyzes a single compilation unit during a build.
The unitchecker package defines the main function for an analysis driver that analyzes a single compilation unit during a build.
xvendor/golang.org/x/tools/go/ast/astutil
Package astutil contains common utilities for working with the Go AST.
Package astutil contains common utilities for working with the Go AST.
xvendor/golang.org/x/tools/go/ast/inspector
Package inspector provides helper functions for traversal over the syntax trees of a package, including node filtering by type, and materialization of the traversal stack.
Package inspector provides helper functions for traversal over the syntax trees of a package, including node filtering by type, and materialization of the traversal stack.
xvendor/golang.org/x/tools/go/cfg
Package cfg constructs a simple control-flow graph (CFG) of the statements and expressions within a single function.
Package cfg constructs a simple control-flow graph (CFG) of the statements and expressions within a single function.
xvendor/golang.org/x/tools/go/types/objectpath
Package objectpath defines a naming scheme for types.Objects (that is, named entities in Go programs) relative to their enclosing package.
Package objectpath defines a naming scheme for types.Objects (that is, named entities in Go programs) relative to their enclosing package.
xvendor/golang.org/x/tools/go/types/typeutil
Package typeutil defines various utilities for types, such as Map, a mapping from types.Type to interface{} values.
Package typeutil defines various utilities for types, such as Map, a mapping from types.Type to interface{} values.
xvendor/golang.org/x/tools/internal/analysisinternal
Package analysisinternal provides gopls' internal analyses with a number of helper functions that operate on typed syntax trees.
Package analysisinternal provides gopls' internal analyses with a number of helper functions that operate on typed syntax trees.
xvendor/golang.org/x/tools/internal/bisect
Package bisect can be used by compilers and other programs to serve as a target for the bisect debugging tool.
Package bisect can be used by compilers and other programs to serve as a target for the bisect debugging tool.
xvendor/golang.org/x/tools/internal/facts
Package facts defines a serializable set of analysis.Fact.
Package facts defines a serializable set of analysis.Fact.
xvendor/golang.org/x/tools/internal/typeparams
Package typeparams contains common utilities for writing tools that interact with generic Go code, as introduced with Go 1.18.
Package typeparams contains common utilities for writing tools that interact with generic Go code, as introduced with Go 1.18.

Jump to

Keyboard shortcuts

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