...

Joueur.go Documentation

This is the documentation for the Go Cadre client and its various game packages.

Games ▾

These are the games that are available to play via the Go Client. Their source code is stored in the directory: games/game_name/, where game_name is the name of the game.

Anarchy
Two player grid based game where each player tries to burn down the other player's buildings. Let it burn.
Catastrophe
Convert as many humans to as you can to survive in this post-apocalyptic wasteland.
Checkers
The simple version of American Checkers. An 8x8 board with 12 checkers on each side that must move diagonally to the opposing side until kinged.
Chess
The traditional 8x8 chess board with pieces.
Coreminer
Mine resources to obtain more value than your opponent.
Necrowar
Send hordes of the undead at your opponent while defending yourself against theirs to win.
Newtonian
Combine elements and be the first scientists to create fusion.
Pirates
Steal from merchants and become the most infamous pirate.
Saloon
Use cowboys to have a good time and play some music on a Piano, while brawling with enemy Cowboys.
Spiders
There's an infestation of enemy spiders challenging your queen BroodMother spider! Protect her and attack the other BroodMother in this turn based, node based, game.
Stardash
Collect of the most of the rarest mineral orbiting around the sun and out-compete your competitor.
Stumped
Gather branches and build up your lodge as beavers fight to survive.

Coding Your AI ▾

Interfaces

With the exception of your AI being a struct, all of the game components you will interact with are done through Go interfaces. This means that all attributes must be accessed via function calls, e.g:

player_name := ai.Player().Name()


Unless otherwise noted in the documentation, assume all interfaces are populated by an instance of a struct implementing that interface. However some attributes, function call, etc will explicitly tell you if the returned value can be nullable (nil pointer).

Modifying non AI files

Each interface type inside of games/game_name/, except for your ai.go should ideally not be modified.
They are intended to be read only constructs that hold the state of that object at the point in time you are reading its properties.

With that being is said, if you really wish to add functionality, such as helper functions, ensure they do not directly modify game state information, or interfere with our existing functionality, or there is a good chance your client will crash during gameplay with a DELTA_MERGE_FAILURE.

Implimentation logic for the interfaces (except your AI) is all tucked away in games/internal/game_name_impl. It is highly reccomended not to modify these files as they are largey written by our Creer code generation tool and may need to be modified if the game structure is tweaked.

Game Logic

If you are attempting to figure out how the logic is executed for a game, that code is not here.
All Cadre game clients are dumb state tracking programs that facilitate IO between a game server and your AI in whatever programming language you choose.

If you wish to get the actual code for a game check in the Cerveau game server. Its directory structure is similar to most clients (such as this one).

Packages

Standard library ▾

Name Synopsis
archive
tar Package tar implements access to tar archives.
zip Package zip provides support for reading and writing ZIP archives.
bufio Package bufio implements buffered I/O. It wraps an io.Reader or io.Writer object, creating another object (Reader or Writer) that also implements the interface but provides buffering and some help for textual I/O.
builtin Package builtin provides documentation for Go's predeclared identifiers.
bytes Package bytes implements functions for the manipulation of byte slices.
compress
bzip2 Package bzip2 implements bzip2 decompression.
flate Package flate implements the DEFLATE compressed data format, described in RFC 1951.
gzip Package gzip implements reading and writing of gzip format compressed files, as specified in RFC 1952.
lzw Package lzw implements the Lempel-Ziv-Welch compressed data format, described in T. A. Welch, “A Technique for High-Performance Data Compression”, Computer, 17(6) (June 1984), pp 8-19.
zlib Package zlib implements reading and writing of zlib format compressed data, as specified in RFC 1950.
container
heap Package heap provides heap operations for any type that implements heap.Interface.
list Package list implements a doubly linked list.
ring Package ring implements operations on circular lists.
context Package context defines the Context type, which carries deadlines, cancellation signals, and other request-scoped values across API boundaries and between processes.
crypto Package crypto collects common cryptographic constants.
aes Package aes implements AES encryption (formerly Rijndael), as defined in U.S. Federal Information Processing Standards Publication 197.
cipher Package cipher implements standard block cipher modes that can be wrapped around low-level block cipher implementations.
des Package des implements the Data Encryption Standard (DES) and the Triple Data Encryption Algorithm (TDEA) as defined in U.S. Federal Information Processing Standards Publication 46-3.
dsa Package dsa implements the Digital Signature Algorithm, as defined in FIPS 186-3.
ecdsa Package ecdsa implements the Elliptic Curve Digital Signature Algorithm, as defined in FIPS 186-3.
ed25519 Package ed25519 implements the Ed25519 signature algorithm.
elliptic Package elliptic implements several standard elliptic curves over prime fields.
hmac Package hmac implements the Keyed-Hash Message Authentication Code (HMAC) as defined in U.S. Federal Information Processing Standards Publication 198.
md5 Package md5 implements the MD5 hash algorithm as defined in RFC 1321.
rand Package rand implements a cryptographically secure random number generator.
rc4 Package rc4 implements RC4 encryption, as defined in Bruce Schneier's Applied Cryptography.
rsa Package rsa implements RSA encryption as specified in PKCS#1.
sha1 Package sha1 implements the SHA-1 hash algorithm as defined in RFC 3174.
sha256 Package sha256 implements the SHA224 and SHA256 hash algorithms as defined in FIPS 180-4.
sha512 Package sha512 implements the SHA-384, SHA-512, SHA-512/224, and SHA-512/256 hash algorithms as defined in FIPS 180-4.
subtle Package subtle implements functions that are often useful in cryptographic code but require careful thought to use correctly.
tls Package tls partially implements TLS 1.2, as specified in RFC 5246, and TLS 1.3, as specified in RFC 8446.
x509 Package x509 parses X.509-encoded keys and certificates.
pkix Package pkix contains shared, low level structures used for ASN.1 parsing and serialization of X.509 certificates, CRL and OCSP.
database
sql Package sql provides a generic interface around SQL (or SQL-like) databases.
driver Package driver defines interfaces to be implemented by database drivers as used by package sql.
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
elf Package elf implements access to ELF object files.
gosym Package gosym implements access to the Go symbol and line number tables embedded in Go binaries generated by the gc compilers.
macho Package macho implements access to Mach-O object files.
pe Package pe implements access to PE (Microsoft Windows Portable Executable) files.
plan9obj Package plan9obj implements access to Plan 9 a.out object files.
encoding Package encoding defines interfaces shared by other packages that convert data to and from byte-level and textual representations.
ascii85 Package ascii85 implements the ascii85 data encoding as used in the btoa tool and Adobe's PostScript and PDF document formats.
asn1 Package asn1 implements parsing of DER-encoded ASN.1 data structures, as defined in ITU-T Rec X.690.
base32 Package base32 implements base32 encoding as specified by RFC 4648.
base64 Package base64 implements base64 encoding as specified by RFC 4648.
binary Package binary implements simple translation between numbers and byte sequences and encoding and decoding of varints.
csv Package csv reads and writes comma-separated values (CSV) files.
gob Package gob manages streams of gobs - binary values exchanged between an Encoder (transmitter) and a Decoder (receiver).
hex Package hex implements hexadecimal encoding and decoding.
json Package json implements encoding and decoding of JSON as defined in RFC 7159.
pem Package pem implements the PEM data encoding, which originated in Privacy Enhanced Mail.
xml Package xml implements a simple XML 1.0 parser that understands XML name spaces.
errors Package errors implements functions to manipulate errors.
expvar Package expvar provides a standardized interface to public variables, such as operation counters in servers.
flag Package flag implements command-line flag parsing.
fmt Package fmt implements formatted I/O with functions analogous to C's printf and scanf.
go
ast Package ast declares the types used to represent syntax trees for Go packages.
build Package build gathers information about Go packages.
constant Package constant implements Values representing untyped Go constants and their corresponding operations.
doc Package doc extracts source code documentation from a Go AST.
format Package format implements standard formatting of Go source.
importer Package importer provides access to export data importers.
parser Package parser implements a parser for Go source files.
printer Package printer implements printing of AST nodes.
scanner Package scanner implements a scanner for Go source text.
token Package token defines constants representing the lexical tokens of the Go programming language and basic operations on tokens (printing, predicates).
types Package types declares the data types and implements the algorithms for type-checking of Go packages.
hash Package hash provides interfaces for hash functions.
adler32 Package adler32 implements the Adler-32 checksum.
crc32 Package crc32 implements the 32-bit cyclic redundancy check, or CRC-32, checksum.
crc64 Package crc64 implements the 64-bit cyclic redundancy check, or CRC-64, checksum.
fnv Package fnv implements FNV-1 and FNV-1a, non-cryptographic hash functions created by Glenn Fowler, Landon Curt Noll, and Phong Vo.
html Package html provides functions for escaping and unescaping HTML text.
template Package template (html/template) implements data-driven templates for generating HTML output safe against code injection.
image Package image implements a basic 2-D image library.
color Package color implements a basic color library.
palette Package palette provides standard color palettes.
draw Package draw provides image composition functions.
gif Package gif implements a GIF image decoder and encoder.
jpeg Package jpeg implements a JPEG image decoder and encoder.
png Package png implements a PNG image decoder and encoder.
index
suffixarray Package suffixarray implements substring search in logarithmic time using an in-memory suffix array.
io Package io provides basic interfaces to I/O primitives.
ioutil Package ioutil implements some I/O utility functions.
joueur Package joueur implements the base logic required to interact with the Cadre AI framework to facilitate playing AI base games.
base Package base implements the shared logic and structures between all games.
games Package games collects and registers all the available games this Joueur client can play.
anarchy Package anarchy contains all the interfaces and AI that are required to represent and play Anarchy.
catastrophe Package catastrophe contains all the interfaces and AI that are required to represent and play Catastrophe.
checkers Package checkers contains all the interfaces and AI that are required to represent and play Checkers.
chess Package chess contains all the interfaces and AI that are required to represent and play Chess.
coreminer Package coreminer contains all the interfaces and AI that are required to represent and play Coreminer.
necrowar Package necrowar contains all the interfaces and AI that are required to represent and play Necrowar.
newtonian Package newtonian contains all the interfaces and AI that are required to represent and play Newtonian.
pirates Package pirates contains all the interfaces and AI that are required to represent and play Pirates.
saloon Package saloon contains all the interfaces and AI that are required to represent and play Saloon.
spiders Package spiders contains all the interfaces and AI that are required to represent and play Spiders.
stardash Package stardash contains all the interfaces and AI that are required to represent and play Stardash.
stumped Package stumped contains all the interfaces and AI that are required to represent and play Stumped.
log Package log implements a simple logging package.
syslog Package syslog provides a simple interface to the system log service.
math Package math provides basic constants and mathematical functions.
big Package big implements arbitrary-precision arithmetic (big numbers).
bits Package bits implements bit counting and manipulation functions for the predeclared unsigned integer types.
cmplx Package cmplx provides basic constants and mathematical functions for complex numbers.
rand Package rand implements pseudo-random number generators.
mime Package mime implements parts of the MIME spec.
multipart Package multipart implements MIME multipart parsing, as defined in RFC 2046.
quotedprintable Package quotedprintable implements quoted-printable encoding as specified by RFC 2045.
net Package net provides a portable interface for network I/O, including TCP/IP, UDP, domain name resolution, and Unix domain sockets.
http Package http provides HTTP client and server implementations.
cgi Package cgi implements CGI (Common Gateway Interface) as specified in RFC 3875.
cookiejar Package cookiejar implements an in-memory RFC 6265-compliant http.CookieJar.
fcgi Package fcgi implements the FastCGI protocol.
httptest Package httptest provides utilities for HTTP testing.
httptrace Package httptrace provides mechanisms to trace the events within HTTP client requests.
httputil Package httputil provides HTTP utility functions, complementing the more common ones in the net/http package.
pprof Package pprof serves via its HTTP server runtime profiling data in the format expected by the pprof visualization tool.
mail Package mail implements parsing of mail messages.
rpc Package rpc provides access to the exported methods of an object across a network or other I/O connection.
jsonrpc Package jsonrpc implements a JSON-RPC 1.0 ClientCodec and ServerCodec for the rpc package.
smtp Package smtp implements the Simple Mail Transfer Protocol as defined in RFC 5321.
textproto Package textproto implements generic support for text-based request/response protocols in the style of HTTP, NNTP, and SMTP.
url Package url parses URLs and implements query escaping.
os Package os provides a platform-independent interface to operating system functionality.
exec Package exec runs external commands.
signal Package signal implements access to incoming signals.
user Package user allows user account lookups by name or id.
path Package path implements utility routines for manipulating slash-separated paths.
filepath Package filepath implements utility routines for manipulating filename paths in a way compatible with the target operating system-defined file paths.
plugin Package plugin implements loading and symbol resolution of Go plugins.
reflect Package reflect implements run-time reflection, allowing a program to manipulate objects with arbitrary types.
regexp Package regexp implements regular expression search.
syntax Package syntax parses regular expressions into parse trees and compiles parse trees into programs.
runtime Package runtime contains operations that interact with Go's runtime system, such as functions to control goroutines.
cgo Package cgo contains runtime support for code generated by the cgo tool.
debug Package debug contains facilities for programs to debug themselves while they are running.
msan
pprof Package pprof writes runtime profiling data in the format expected by the pprof visualization tool.
race Package race implements data race detection logic.
trace Package trace contains facilities for programs to generate traces for the Go execution tracer.
sort Package sort provides primitives for sorting slices and user-defined collections.
strconv Package strconv implements conversions to and from string representations of basic data types.
strings Package strings implements simple functions to manipulate UTF-8 encoded strings.
sync Package sync provides basic synchronization primitives such as mutual exclusion locks.
atomic Package atomic provides low-level atomic memory primitives useful for implementing synchronization algorithms.
syscall Package syscall contains an interface to the low-level operating system primitives.
js Package js gives access to the WebAssembly host environment when using the js/wasm architecture.
testing Package testing provides support for automated testing of Go packages.
iotest Package iotest implements Readers and Writers useful mainly for testing.
quick Package quick implements utility functions to help with black box testing.
text
scanner Package scanner provides a scanner and tokenizer for UTF-8-encoded text.
tabwriter Package tabwriter implements a write filter (tabwriter.Writer) that translates tabbed columns in input into properly aligned text.
template Package template implements data-driven templates for generating textual output.
parse Package parse builds parse trees for templates as defined by text/template and html/template.
time Package time provides functionality for measuring and displaying time.
unicode Package unicode provides data and functions to test some properties of Unicode code points.
utf16 Package utf16 implements encoding and decoding of UTF-16 sequences.
utf8 Package utf8 implements functions and constants to support text encoded in UTF-8.
unsafe Package unsafe contains operations that step around the type safety of Go programs.

Third party ▾

Name Synopsis
github.com
JacobFischer
argparse Package argparse provides users with more flexible and configurable option for command line arguments parsing.
examples
command-help
commands
commands-advanced
zoo
default
flags
help
positionals
print
required-args
sleep
fatih
color Package color is an ANSI color package to output colorized or SGR defined output to the standard output.
mattn
go-colorable
cmd
colorable
go-isatty Package isatty implements interface to isatty
golang.org
x
crypto
acme Package acme provides an implementation of the Automatic Certificate Management Environment (ACME) spec.
autocert Package autocert provides automatic access to certificates from Let's Encrypt and any other ACME-based CA.
argon2 Package argon2 implements the key derivation function Argon2.
bcrypt Package bcrypt implements Provos and Mazières's bcrypt adaptive hashing algorithm.
blake2b Package blake2b implements the BLAKE2b hash algorithm defined by RFC 7693 and the extendable output function (XOF) BLAKE2Xb.
blake2s Package blake2s implements the BLAKE2s hash algorithm defined by RFC 7693 and the extendable output function (XOF) BLAKE2Xs.
blowfish Package blowfish implements Bruce Schneier's Blowfish encryption algorithm.
bn256 Package bn256 implements a particular bilinear group.
cast5 Package cast5 implements CAST5, as defined in RFC 2144.
chacha20poly1305 Package chacha20poly1305 implements the ChaCha20-Poly1305 AEAD as specified in RFC 7539, and its extended nonce variant XChaCha20-Poly1305.
cryptobyte Package cryptobyte contains types that help with parsing and constructing length-prefixed, binary messages, including ASN.1 DER.
asn1 Package asn1 contains supporting types for parsing and building ASN.1 messages with the cryptobyte package.
curve25519 Package curve25519 provides an implementation of scalar multiplication on the elliptic curve known as curve25519.
ed25519 Package ed25519 implements the Ed25519 signature algorithm.
hkdf Package hkdf implements the HMAC-based Extract-and-Expand Key Derivation Function (HKDF) as defined in RFC 5869.
md4 Package md4 implements the MD4 hash algorithm as defined in RFC 1320.
nacl
auth Package auth authenticates a message using a secret key.
box Package box authenticates and encrypts small messages using public-key cryptography.
secretbox Package secretbox encrypts and authenticates small messages.
sign Package sign signs small messages using public-key cryptography.
ocsp Package ocsp parses OCSP responses as specified in RFC 2560.
openpgp Package openpgp implements high level operations on OpenPGP messages.
armor Package armor implements OpenPGP ASCII Armor, see RFC 4880.
clearsign Package clearsign generates and processes OpenPGP, clear-signed data.
elgamal Package elgamal implements ElGamal encryption, suitable for OpenPGP, as specified in "A Public-Key Cryptosystem and a Signature Scheme Based on Discrete Logarithms," IEEE Transactions on Information Theory, v.
errors Package errors contains common error types for the OpenPGP packages.
packet Package packet implements parsing and serialization of OpenPGP packets, as specified in RFC 4880.
s2k Package s2k implements the various OpenPGP string-to-key transforms as specified in RFC 4800 section 3.7.1.
otr Package otr implements the Off The Record protocol as specified in http://www.cypherpunks.ca/otr/Protocol-v2-3.1.0.html The version of OTR implemented by this package has been deprecated (https://bugs.otr.im/lib/libotr/issues/140).
pbkdf2 Package pbkdf2 implements the key derivation function PBKDF2 as defined in RFC 2898 / PKCS #5 v2.0.
pkcs12 Package pkcs12 implements some of PKCS#12.
poly1305 Package poly1305 implements Poly1305 one-time message authentication code as specified in https://cr.yp.to/mac/poly1305-20050329.pdf.
ripemd160 Package ripemd160 implements the RIPEMD-160 hash algorithm.
salsa20 Package salsa20 implements the Salsa20 stream cipher as specified in https://cr.yp.to/snuffle/spec.pdf.
salsa Package salsa provides low-level access to functions in the Salsa family.
scrypt Package scrypt implements the scrypt key derivation function as defined in Colin Percival's paper "Stronger Key Derivation via Sequential Memory-Hard Functions" (https://www.tarsnap.com/scrypt/scrypt.pdf).
sha3 Package sha3 implements the SHA-3 fixed-output-length hash functions and the SHAKE variable-output-length hash functions defined by FIPS-202.
ssh Package ssh implements an SSH client and server.
agent Package agent implements the ssh-agent protocol, and provides both a client and a server.
knownhosts Package knownhosts implements a parser for the OpenSSH known_hosts host key database, and provides utility functions for writing OpenSSH compliant known_hosts files.
terminal Package terminal provides support functions for dealing with terminals, as commonly found on UNIX systems.
test Package test contains integration tests for the golang.org/x/crypto/ssh package.
tea Package tea implements the TEA algorithm, as defined in Needham and Wheeler's 1994 technical report, “TEA, a Tiny Encryption Algorithm”.
twofish Package twofish implements Bruce Schneier's Twofish encryption algorithm.
xtea Package xtea implements XTEA encryption, as defined in Needham and Wheeler's 1997 technical report, "Tea extensions." XTEA is a legacy cipher and its short block size makes it vulnerable to birthday bound attacks (see https://sweet32.info).
xts Package xts implements the XTS cipher mode as specified in IEEE P1619/D16.
mod
gosumcheck Gosumcheck checks a go.sum file against a go.sum database server.
modfile
module Package module defines the module.Version type along with support code.
semver Package semver implements comparison of semantic version strings.
sumdb Package sumdb implements the HTTP protocols for serving or accessing a module checksum database.
dirhash Package dirhash defines hashes over directory trees.
note Package note defines the notes signed by the Go module database server.
storage Package storage defines storage interfaces for and a basic implementation of a checksum database.
tlog Package tlog implements a tamper-evident log used in the Go module go.sum database server.
zip Package zip provides functions for creating and extracting module zip files.
net
bpf Package bpf implements marshaling and unmarshaling of programs for the Berkeley Packet Filter virtual machine, and provides a Go implementation of the virtual machine.
context Package context defines the Context type, which carries deadlines, cancelation signals, and other request-scoped values across API boundaries and between processes.
ctxhttp Package ctxhttp provides helper functions for performing context-aware HTTP requests.
dict Package dict implements the Dictionary Server Protocol as defined in RFC 2229.
dns
dnsmessage Package dnsmessage provides a mostly RFC 1035 compliant implementation of DNS message packing and unpacking.
html Package html implements an HTML5-compliant tokenizer and parser.
atom Package atom provides integer codes (also known as atoms) for a fixed set of frequently occurring HTML strings: tag names and attribute keys such as "p" and "id".
charset Package charset provides common text encodings for HTML documents.
http
httpguts Package httpguts provides functions implementing various details of the HTTP specification.
httpproxy Package httpproxy provides support for HTTP proxy determination based on environment variables, as provided by net/http's ProxyFromEnvironment function.
http2 Package http2 implements the HTTP/2 protocol.
h2c Package h2c implements the unencrypted "h2c" form of HTTP/2.
h2i The h2i command is an interactive HTTP/2 console.
hpack Package hpack implements HPACK, a compression format for efficiently representing HTTP header fields in the context of HTTP/2.
icmp Package icmp provides basic functions for the manipulation of messages used in the Internet Control Message Protocols, ICMPv4 and ICMPv6.
idna Package idna implements IDNA2008 using the compatibility processing defined by UTS (Unicode Technical Standard) #46, which defines a standard to deal with the transition from IDNA2003.
ipv4 Package ipv4 implements IP-level socket options for the Internet Protocol version 4.
ipv6 Package ipv6 implements IP-level socket options for the Internet Protocol version 6.
lif Package lif provides basic functions for the manipulation of logical network interfaces and interface addresses on Solaris.
nettest Package nettest provides utilities for network testing.
netutil Package netutil provides network utility functions, complementing the more common ones in the net package.
proxy Package proxy provides support for a variety of protocols to proxy network data.
publicsuffix Package publicsuffix provides a public suffix list based on data from https://publicsuffix.org/ A public suffix is one under which Internet users can directly register names.
route Package route provides basic functions for the manipulation of packet routing facilities on BSD variants.
trace Package trace implements tracing of requests and long-lived objects.
webdav Package webdav provides a WebDAV server implementation.
websocket Package websocket implements a client and server for the WebSocket protocol as specified in RFC 6455.
xsrftoken Package xsrftoken provides methods for generating and validating secure XSRF tokens.
sync
errgroup Package errgroup provides synchronization, error propagation, and Context cancelation for groups of goroutines working on subtasks of a common task.
semaphore Package semaphore provides a weighted semaphore implementation.
singleflight Package singleflight provides a duplicate function call suppression mechanism.
syncmap Package syncmap provides a concurrent map implementation.
sys
cpu Package cpu implements processor feature detection for various CPU architectures.
plan9 Package plan9 contains an interface to the low-level operating system primitives.
unix Package unix contains an interface to the low-level operating system primitives.
linux
windows Package windows contains an interface to the low-level operating system primitives.
mkwinsyscall mkwinsyscall generates windows system call bodies It parses all files specified on command line containing function prototypes (like syscall_windows.go) and prints system call bodies to standard output.
registry Package registry provides access to the Windows registry.
svc Package svc provides everything required to build Windows service.
debug Package debug provides facilities to execute svc.Handler on console.
eventlog Package eventlog implements access to Windows event log.
example Example service program that beeps.
mgr Package mgr can be used to manage Windows service programs.
text text is a repository of text-related packages related to internationalization (i18n) and localization (l10n), such as character encodings, text transformations, and locale-specific text handling.
cases Package cases provides general and language-specific case mappers.
cmd
gotext gotext is a tool for managing text in Go source code.
examples
extract
extract_http
pkg
rewrite
collate Package collate contains types for comparing and sorting Unicode strings according to a given collation order.
build
tools
colcmp
currency Package currency contains currency-related functionality.
date
encoding Package encoding defines an interface for character encodings, such as Shift JIS and Windows 1252, that can convert to and from UTF-8.
charmap Package charmap provides simple character encodings such as IBM Code Page 437 and Windows 1252.
htmlindex Package htmlindex maps character set encoding names to Encodings as recommended by the W3C for use in HTML 5.
ianaindex Package ianaindex maps names to Encodings as specified by the IANA registry.
japanese Package japanese provides Japanese encodings such as EUC-JP and Shift JIS.
korean Package korean provides Korean encodings such as EUC-KR.
simplifiedchinese Package simplifiedchinese provides Simplified Chinese encodings such as GBK.
traditionalchinese Package traditionalchinese provides Traditional Chinese encodings such as Big5.
unicode Package unicode provides Unicode encodings such as UTF-16.
utf32 Package utf32 provides the UTF-32 Unicode encoding.
feature
plural Package plural provides utilities for handling linguistic plurals in text.
language Package language implements BCP 47 language tags and related functionality.
display Package display provides display names for languages, scripts and regions in a requested language.
message Package message implements formatted I/O for localized strings with functions analogous to the fmt's print functions.
catalog Package catalog defines collections of translated format strings.
pipeline Package pipeline provides tools for creating translation pipelines.
number Package number formats numbers according to the customs of different locales.
runes Package runes provide transforms for UTF-8 encoded text.
search Package search provides language-specific search and string matching.
secure secure is a repository of text security related packages.
bidirule Package bidirule implements the Bidi Rule defined by RFC 5893.
precis Package precis contains types and functions for the preparation, enforcement, and comparison of internationalized strings ("PRECIS") as defined in RFC 8264.
transform Package transform provides reader and writer wrappers that transform the bytes passing through as well as various transformations.
unicode unicode holds packages with implementations of Unicode standards that are mostly used as building blocks for other packages in golang.org/x/text, layout engines, or are otherwise more low-level in nature.
bidi Package bidi contains functionality for bidirectional text support.
cldr Package cldr provides a parser for LDML and related XML formats.
norm Package norm contains types and functions for normalizing Unicode strings.
rangetable Package rangetable provides utilities for creating and inspecting unicode.RangeTables.
runenames Package runenames provides rune names from the Unicode Character Database.
width Package width provides functionality for handling different widths in text.
tools
benchmark
parse Package parse provides support for parsing benchmark results as generated by 'go test -bench'.
blog Package blog implements a web server for articles written in present format.
atom Package atom defines XML data structures for an Atom feed.
cmd
auth
authtest authtest is a diagnostic tool for implementations of the GOAUTH protocol described in https://golang.org/issue/26232.
cookieauth cookieauth uses a “Netscape cookie file” to implement the GOAUTH protocol described in https://golang.org/issue/26232.
gitauth gitauth uses 'git credential' to implement the GOAUTH protocol described in https://golang.org/issue/26232.
netrcauth netrcauth uses a .netrc file (or _netrc file on Windows) to implement the GOAUTH protocol described in https://golang.org/issue/26232.
benchcmp The benchcmp command displays performance changes between benchmarks.
bundle Bundle creates a single-source-file version of a source package suitable for inclusion in a particular target package.
callgraph callgraph: a tool for reporting the call graph of a Go program.
compilebench Compilebench benchmarks the speed of the Go compiler.
cover Cover is a program for analyzing the coverage profiles generated by 'go test -coverprofile=cover.out'.
digraph The digraph command performs queries over unlabelled directed graphs represented in text form.
eg The eg command performs example-based refactoring.
fiximports The fiximports command fixes import declarations to use the canonical import path for packages that have an "import comment" as defined by https://golang.org/s/go14customimport.
getgo The getgo command installs Go to the user's system.
server Command server serves get.golang.org, redirecting users to the appropriate getgo installer based on the request path.
go-contrib-init The go-contrib-init command helps new Go contributors get their development environment set up for the Go contribution process.
godex The godex command prints (dumps) exported information of packages or selected package objects.
godoc Godoc extracts and generates documentation for Go programs.
goimports Command goimports updates your Go import lines, adding missing ones and removing unreferenced ones.
gomvpkg The gomvpkg command moves go packages, updating import declarations.
gopls The gopls command is an LSP server for Go.
gorename The gorename command performs precise type-safe renaming of identifiers in Go source code.
gotype The gotype command, like the front-end of a Go compiler, parses and type-checks a single Go package.
goyacc Goyacc is a version of yacc for Go.
guru guru: a tool for answering questions about Go source code.
serial Package serial defines the guru's schema for -json output.
html2article This program takes an HTML file and outputs a corresponding article file in present format.
present Present displays slide presentations and articles.
splitdwarf Splitdwarf uncompresses and copies the DWARF segment of a Mach-O executable into the "dSYM" file expected by lldb and ports of gdb on OSX.
ssadump ssadump: a tool for displaying and interpreting the SSA form of Go programs.
stress The stress utility is intended for catching sporadic failures.
stringer Stringer is a tool to automate the creation of methods that satisfy the fmt.Stringer interface.
toolstash Toolstash provides a way to save, run, and restore a known good copy of the Go toolchain and to compare the object files generated by two toolchains.
container
intsets Package intsets provides Sparse, a compact and fast representation for sparse sets of int values.
cover Package cover provides support for parsing coverage profiles generated by "go test -coverprofile=cover.out".
go
analysis The analysis package defines the interface between a modular static analysis and an analysis driver program.
analysistest Package analysistest provides utilities for testing analyzers.
multichecker Package multichecker defines the main function for an analysis driver with several analyzers.
passes
asmdecl Package asmdecl defines an Analyzer that reports mismatches between assembly files and Go declarations.
assign Package assign defines an Analyzer that detects useless assignments.
atomic Package atomic defines an Analyzer that checks for common mistakes using the sync/atomic package.
atomicalign Package atomicalign defines an Analyzer that checks for non-64-bit-aligned arguments to sync/atomic functions.
bools Package bools defines an Analyzer that detects common mistakes involving boolean operators.
buildssa Package buildssa defines an Analyzer that constructs the SSA representation of an error-free package and returns the set of all functions within it.
buildtag Package buildtag defines an Analyzer that checks build tags.
cgocall Package cgocall defines an Analyzer that detects some violations of the cgo pointer passing rules.
composite Package composite defines an Analyzer that checks for unkeyed composite literals.
copylock Package copylock defines an Analyzer that checks for locks erroneously passed by value.
ctrlflow Package ctrlflow is an analysis that provides a syntactic control-flow graph (CFG) for the body of a function.
deepequalerrors Package deepequalerrors defines an Analyzer that checks for the use of reflect.DeepEqual with error values.
errorsas The errorsas package defines an Analyzer that checks that the second argument to errors.As is a pointer to a type implementing error.
findcall
cmd
findcall The findcall command runs the findcall analyzer.
httpresponse Package httpresponse defines an Analyzer that checks for mistakes using HTTP responses.
inspect Package inspect defines an Analyzer that provides an AST inspector (golang.org/x/tools/go/ast/inspect.Inspect) for the syntax trees of a package.
loopclosure Package loopclosure defines an Analyzer that checks for references to enclosing loop variables from within nested functions.
lostcancel Package lostcancel defines an Analyzer that checks for failure to call a context cancellation function.
cmd
lostcancel The lostcancel command applies the golang.org/x/tools/go/analysis/passes/lostcancel analysis to the specified packages of Go source code.
nilfunc Package nilfunc defines an Analyzer that checks for useless comparisons against nil.
nilness Package nilness inspects the control-flow graph of an SSA function and reports errors such as nil pointer dereferences and degenerate nil pointer comparisons.
cmd
nilness The nilness command applies the golang.org/x/tools/go/analysis/passes/nilness analysis to the specified packages of Go source code.
pkgfact The pkgfact package is a demonstration and test of the package fact mechanism.
printf
shadow
cmd
shadow The shadow command runs the shadow analyzer.
shift Package shift defines an Analyzer that checks for shifts that exceed the width of an integer.
sortslice Package sortslice defines an Analyzer that checks for calls to sort.Slice that do not use a slice type as first argument.
stdmethods Package stdmethods defines an Analyzer that checks for misspellings in the signatures of methods similar to well-known interfaces.
structtag Package structtag defines an Analyzer that checks struct field tags are well formed.
tests Package tests defines an Analyzer that checks for common mistaken usages of tests and examples.
unmarshal The unmarshal package defines an Analyzer that checks for passing non-pointer or non-interface types to unmarshal and decode functions.
cmd
unmarshal The unmarshal command runs the unmarshal analyzer.
unreachable Package unreachable defines an Analyzer that checks for unreachable code.
unsafeptr Package unsafeptr defines an Analyzer that checks for invalid conversions of uintptr to unsafe.Pointer.
unusedresult Package unusedresult defines an analyzer that checks for unused results of calls to certain pure functions.
singlechecker Package singlechecker defines the main function for an analysis driver with only a single analysis.
unitchecker The unitchecker package defines the main function for an analysis driver that analyzes a single compilation unit during a build.
ast
astutil Package astutil contains common utilities for working with the 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.
buildutil Package buildutil provides utilities related to the go/build package in the standard library.
callgraph Package callgraph defines the call graph and various algorithms and utilities to operate on it.
cha Package cha computes the call graph of a Go program using the Class Hierarchy Analysis (CHA) algorithm.
rta This package provides Rapid Type Analysis (RTA) for Go, a fast algorithm for call graph construction and discovery of reachable code (and hence dead code) and runtime types.
static Package static computes the call graph of a Go program containing only static call edges.
cfg This package constructs a simple control-flow graph (CFG) of the statements and expressions within a single function.
expect Package expect provides support for interpreting structured comments in Go source code as test expectations.
gccgoexportdata Package gccgoexportdata provides functions for reading export data files containing type information produced by the gccgo compiler.
gcexportdata Package gcexportdata provides functions for locating, reading, and writing export data files containing type information produced by the gc compiler.
loader Package loader loads a complete Go program from source code, parsing and type-checking the initial packages plus their transitive closure of dependencies.
packages Package packages loads Go packages for inspection and analysis.
gopackages The gopackages command is a diagnostic tool that demonstrates how to use golang.org/x/tools/go/packages to load, parse, type-check, and print one or more Go packages.
packagestest Package packagestest creates temporary projects on disk for testing go tools on.
pointer Package pointer implements Andersen's analysis, an inclusion-based pointer analysis algorithm first described in (Andersen, 1994).
ssa Package ssa defines a representation of the elements of Go programs (packages, types, functions, variables and constants) using a static single-assignment (SSA) form intermediate representation (IR) for the bodies of functions.
interp Package ssa/interp defines an interpreter for the SSA representation of Go programs.
ssautil
types
objectpath Package objectpath defines a naming scheme for types.Objects (that is, named entities in Go programs) relative to their enclosing package.
typeutil Package typeutil defines various utilities for types, such as Map, a mapping from types.Type to interface{} values.
vcs Package vcs exposes functions for resolving import paths and using version control systems, which can be used to implement behavior similar to the standard "go get" command.
godoc Package godoc is a work-in-progress (2013-07-17) package to begin splitting up the godoc binary into multiple pieces.
analysis Package analysis performs type and pointer analysis and generates mark-up for the Go source view.
golangorgenv Package golangorgenv provides environment information for programs running at golang.org and its subdomains.
redirect Package redirect provides hooks to register HTTP handlers that redirect old godoc paths to their new equivalents and assist in accessing the issue tracker, wiki, code review system, etc.
static Package static exports a map of static file content that supports the godoc user interface.
util Package util contains utility types and functions for godoc.
vfs Package vfs defines types for abstract file system access and provides an implementation accessing the file system of the underlying OS.
gatefs Package gatefs provides an implementation of the FileSystem interface that wraps another FileSystem and limits its concurrency.
httpfs Package httpfs implements http.FileSystem using a godoc vfs.FileSystem.
mapfs Package mapfs file provides an implementation of the FileSystem interface based on the contents of a map[string]string.
zipfs Package zipfs file provides an implementation of the FileSystem interface based on the contents of a .zip file.
imports Package imports implements a Go pretty-printer (like package "go/format") that also adds or removes import statements as necessary.
playground Package playground registers HTTP handlers at "/compile" and "/share" that proxy requests to the golang.org playground service.
socket Package socket implements an WebSocket-based playground backend.
present The present file format Present files have the following format.
refactor
eg Package eg implements the example-based refactoring tool whose command-line is defined in golang.org/x/tools/cmd/eg.
importgraph Package importgraph computes the forward and reverse import dependency graphs for all packages in a Go workspace.
rename Package rename contains the implementation of the 'gorename' command whose main function is in golang.org/x/tools/cmd/gorename.
satisfy Package satisfy inspects the type-checked ASTs of Go packages and reports the set of discovered type constraints of the form (lhs, rhs Type) where lhs is a non-trivial interface, rhs satisfies this interface, and this fact is necessary for the package to be well-typed.
txtar Package txtar implements a trivial text-based file archive format.
xerrors Package xerrors implements functions to manipulate errors.

Other packages

Sub-repositories

These packages are part of the Go Project but outside the main Go tree. They are developed under looser compatibility requirements than the Go core. Install them with "go get".

Community

These services can help you find Open Source packages provided by the community.