• Stars
    star
    832
  • Rank 54,811 (Top 2 %)
  • Language
    Go
  • License
    BSD 3-Clause "New...
  • Created about 6 years ago
  • Updated 4 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Selected Go-internal packages factored out from the standard library

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.

This repo is primarily maintained by long-time Go contributors who are also currently maintaining CUE (which is primarily written in Go and which relies upon several of the packages here).

Contributions are welcome, but please open an issue for discussion first.

Packages

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.

testscript

The most popular package here is the testscript package:

  • Provides a shell-like test environment that is very nicely tuned for testing Go CLI commands.
  • Extracted from the core Go team's internal testscript package (cmd/go/internal/script), which is heavily used to test the go command.
  • Supports patterns for checking stderr/stdout, command pass/fail assertions, and so on.
  • Integrates well with go test, including coverage support.
  • Inputs and sample output files can use the simple txtar text archive format, also used by the Go playground.
  • Allows automatically updating golden files.
  • Built-in support for Go concepts like build tags.
  • Accompanied by a testscript command for running standalone scripts with files embedded in txtar format.

A nice introduction to using testscripts is this blog post series. Both testscript and txtar were originally created by Russ Cox.

More Repositories

1

gohack

Make temporary edits to your Go module dependencies
Go
897
star
2

godef

Print where symbols are defined in Go source code
Go
666
star
3

fastuuid

Fast generation of 192-bit UUIDs
Go
82
star
4

govers

A tool for rewriting Go import paths
Go
80
star
5

showdeps

show Go package dependencies
Go
51
star
6

rog-go

Automatically exported from code.google.com/p/rog-go
Go
34
star
7

godeps

Simple dependency locking tool for Go
Go
24
star
8

gomodmerge

merge go.mod files
Go
18
star
9

retry

Efficient for-loop retries in Go
Go
18
star
10

testscript

A fork of rogpeppe/go-internal/testscript with less dependencies
Go
17
star
11

netdelay

Go packages for adding delay and buffering to network connections
Go
16
star
12

ociregistry

Ergonomic OCI registry Go API
16
star
13

godate

A simple command to print dates with Go-style formatting
Go
15
star
14

misc

miscellaneous Go packages
Go
12
star
15

generic

Go
11
star
16

sortimports

sortimports - a command to sort import paths in Go files.
Go
9
star
17

modcop

Policing your Go depdndencies
Go
9
star
18

cueconfig

Easy CUE-based configuration for your Go programs
Go
7
star
19

go-charset

charset conversions in Go (superceded)
Go
7
star
20

fstream

Experiment in async directory tree streaming using Rust
Rust
6
star
21

bhttp

A Go clone of httpie that groks macaroon authorization.
Go
5
star
22

doorbell

A musical doorbell using TinyGo
Go
5
star
23

cue-config-demo

An example package showing how CUE can be used for configuration in Go programs
Go
5
star
24

rjson

"readable JSON" - JSON-compatible codec with a few tweaks to make it quicker to write and easier to read
Go
5
star
25

AI

support for OpenAI interaction in the acme text editor
Go
4
star
26

talks

Some Go talks I have given
HTML
4
star
27

genericdemo

Some ideas about how generic code might be generated for Go
Go
4
star
28

json

Print JSON values on the command line
Go
3
star
29

ebnf2regexp

convert Go-specification-style EBNF to regular expression (experimental)
Go
3
star
30

agitlink

An acme tool to show git permalinks to selected text
Go
3
star
31

hroute

experimental http router
Go
3
star
32

apipe

pipe acme window contents through a command
Go
3
star
33

hkt

hard fork of heetch/hkt
Go
2
star
34

annotatedcsv

Go library to parse annotated CSV and commands to process it.
Go
2
star
35

go-fuzz-profiling

Go
2
star
36

cl-xmlspam

concise, regexp-like pattern matching on streaming XML with Common Lisp.
Common Lisp
2
star
37

acmeclean

A version of Russ Cox's acme Clean command
Go
2
star
38

grpc-workshop

Resources for workshop on gRPC
2
star
39

slogtext

A Go log/slog Handler like slog.TextHandler but with JSON formatting of structured values
Go
2
star
40

configcat-cue

cue definitions for configcat configuration data
CUE
1
star
41

cuemodtest

testing cue module publishing
CUE
1
star
42

hydro

experimental household power control for hydroelectric scheme
JavaScript
1
star
43

blobstore

Go
1
star
44

macaroon-cmd

A command-line tool for manipulating macaroons
Go
1
star
45

pkmacaroon

Go
1
star
46

scrape-slack-spotify

Scrape all spotify links in a slack channel to make a spotify playlist.
Go
1
star
47

gnuflag

Go flag package with same API as stdlib flag but parsing GNU-style --flagname flags
Go
1
star