README

This repository factors out an opinionated selection of internal packages and functionality from the Go standard library. Currently this consists mostly of packages and testing code from within the Go tool implementation.

Included are the following:

  • dirhash: calculate hashes over directory trees the same way that the Go tool does.
  • goproxytest: a GOPROXY implementation designed for test use.
  • gotooltest: Use the Go tool inside test scripts (see testscript below)
  • imports: list of known architectures and OSs, and support for reading import statements.
  • modfile: read and write go.mod files while preserving formatting and comments.
  • module: module paths and versions.
  • par: do work in parallel.
  • semver: semantic version parsing.
  • testenv: information on the current testing environment.
  • testscript: script-based testing based on txtar files
  • txtar: simple text-based file archives for testing.
Expand ▾ Collapse ▴

Directories

Path Synopsis
Package cache implements a build artifact cache.
Package cache implements a build artifact cache.
cmd
txtar-addmod
The txtar-addmod command adds a module as a txtar archive to the a testdata module directory as understood by the goproxytest package (see https://godoc.org/github.com/rogpeppe/go-internal/goproxytest).
The txtar-addmod command adds a module as a txtar archive to the a testdata module directory as understood by the goproxytest package (see https://godoc.org/github.com/rogpeppe/go-internal/goproxytest).
txtar-c
The txtar-c command archives a directory tree as a txtar archive printed to standard output.
The txtar-c command archives a directory tree as a txtar archive printed to standard output.
txtar-goproxy
The txtar-goproxy command runs a Go module proxy from a txtar module directory (as manipulated by the txtar-addmod command).
The txtar-goproxy command runs a Go module proxy from a txtar module directory (as manipulated by the txtar-addmod command).
txtar-x
The txtar-x command extracts a txtar archive to a filesystem.
The txtar-x command extracts a txtar archive to a filesystem.
Package dirhash defines hashes over directory trees.
Package dirhash defines hashes over directory trees.
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.
Package goproxytest serves Go modules from a proxy server designed to run on localhost during tests, both to make tests avoid requiring specific network servers and also to make them significantly faster.
Package goproxytest serves Go modules from a proxy server designed to run on localhost during tests, both to make tests avoid requiring specific network servers and also to make them significantly faster.
Package gotooltest implements functionality useful for testing tools that use the go command.
Package gotooltest implements functionality useful for testing tools that use the go command.
Package lockedfile creates and manipulates files whose contents should only change atomically.
Package lockedfile creates and manipulates files whose contents should only change atomically.
Package modfile implements parsing and formatting for go.mod files.
Package modfile implements parsing and formatting for go.mod files.
Package module defines the module.Version type along with support code.
Package module defines the module.Version type along with support code.
Package par implements parallel execution helpers.
Package par implements parallel execution helpers.
Package renameio writes files atomically by renaming temporary files.
Package renameio writes files atomically by renaming temporary files.
Package semver implements comparison of semantic version strings.
Package semver implements comparison of semantic version strings.
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.
Package testscript provides support for defining filesystem-based tests by creating scripts in a directory.
Package testscript provides support for defining filesystem-based tests by creating scripts in a directory.
Package txtar implements a trivial text-based file archive format.
Package txtar implements a trivial text-based file archive format.
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.
textutil
package textutil contains text processing utilities.
package textutil contains text processing utilities.