gotils/

directory
v0.6.9-alpha.9 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2023 License: Apache-2.0, 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, utilities, 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 auth provides access to user-provided authentication credentials.
Package auth provides access to user-provided authentication credentials.
Package browser provides utilities for interacting with users' browsers.
Package browser provides utilities for interacting with users' browsers.
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.
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.
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 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.
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