gotils/

directory
v0.6.8-ci.4 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2023 License: BSD-3-Clause, BSD-3-Clause

README

go-internal - awesome utils from the go compiler

The Go compiler, whether surprisingly or not, has a ton of incredible code, utilties, and other hidden gems. Many rely on internal packages and so we cannot import them directly.

This repository contains code extracted from the Go compiler and modified to fit more general purposes. You can find example usage around the code base.

Using

GitHub Release go.dev reference hof docs GitHub All Releases Gitter


Original readme from source fork

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 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.

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/hofstadter-io/hof/lib/gotils/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/hofstadter-io/hof/lib/gotils/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.
intern
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.
Package lockedfile creates and manipulates files whose contents should only change atomically.
Package lockedfile creates and manipulates files whose contents should only change atomically.
internal/filelock
Package filelock provides a platform-independent API for advisory file locking.
Package filelock provides a platform-independent API for advisory file locking.
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 txtar implements a trivial text-based file archive format.
Package txtar implements a trivial text-based file archive format.

Jump to

Keyboard shortcuts

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