fix godoc.org / pkg.go.dev links

Sean Liao 2022-01-22 16:52:18 +01:00
parent d5eceb617e
commit 6fe9f52ac7
23 changed files with 87 additions and 92 deletions

@ -46,7 +46,7 @@ Additional comments related to testing can be found at [Go Test Comments](https:
Run [gofmt](https://golang.org/cmd/gofmt/) on your code to automatically fix the majority of mechanical style issues. Almost all Go code in the wild uses `gofmt`. The rest of this document addresses non-mechanical style points.
An alternative is to use [goimports](https://godoc.org/golang.org/x/tools/cmd/goimports), a superset of `gofmt` which additionally adds (and removes) import lines as necessary.
An alternative is to use [goimports](https://pkg.go.dev/golang.org/x/tools/cmd/goimports), a superset of `gofmt` which additionally adds (and removes) import lines as necessary.
## Comment Sentences
@ -220,7 +220,7 @@ import (
)
```
<a href="https://godoc.org/golang.org/x/tools/cmd/goimports">goimports</a> will do this for you.
<a href="https://pkg.go.dev/golang.org/x/tools/cmd/goimports">goimports</a> will do this for you.
## Import Blank

@ -15,7 +15,7 @@ An overview of tools that will help improve your Go code
- [gofmt](https://golang.org/cmd/gofmt/) - Start with the standard Go code formatter
- [golint](https://github.com/golang/lint) - Detects style mistakes in Go code
- [goimports](https://godoc.org/golang.org/x/tools/cmd/goimports) - Format code and fix your import statements
- [goimports](https://pkg.go.dev/golang.org/x/tools/cmd/goimports) - Format code and fix your import statements
- [gofumpt](https://github.com/mvdan/gofumpt) - A stricter gofmt
- [revive](https://github.com/mgechev/revive) - Fast, configurable, extensible, flexible, and beautiful linter for Go
@ -39,7 +39,7 @@ An overview of tools that will help improve your Go code
### Tools
- [eg](https://godoc.org/golang.org/x/tools/cmd/eg) - Example-based refactoring tool for Go
- [eg](https://pkg.go.dev/golang.org/x/tools/cmd/eg) - Example-based refactoring tool for Go
- [gofmt](https://golang.org/cmd/gofmt/) - Start with the standard Go code formatter
- [gorename](https://golang.org/x/tools/refactor/rename) - Renaming tool for Go

@ -1,6 +1,6 @@
# Error Values: Frequently Asked Questions
The Go 2 [error values proposal](https://go.googlesource.com/proposal/+/master/design/29934-error-values.md) adds functionality to the [`errors`](https://tip.golang.org/pkg/errors) and [`fmt`](https://tip.golang.org/pkg/fmt) packages of the standard library for Go 1.13. There is also a compatibility package, [`golang.org/x/xerrors`](https://godoc.org/golang.org/x/xerrors), for earlier Go versions.
The Go 2 [error values proposal](https://go.googlesource.com/proposal/+/master/design/29934-error-values.md) adds functionality to the [`errors`](https://tip.golang.org/pkg/errors) and [`fmt`](https://tip.golang.org/pkg/fmt) packages of the standard library for Go 1.13. There is also a compatibility package, [`golang.org/x/xerrors`](https://pkg.go.dev/golang.org/x/xerrors), for earlier Go versions.
We suggest using the `xerrors` package for backwards compatibility. When you no longer wish to support Go versions before 1.13, use the corresponding standard library functions. This FAQ uses the `errors` and `fmt` packages from Go 1.13.

@ -10,14 +10,14 @@ To signal that a package is frozen and is not accepting new features, add a para
// The syslog package is frozen and is not accepting new features.
// Some external packages provide more functionality. See:
//
// https://godoc.org/?q=syslog
// https://pkg.go.dev/search?q=syslog
```
```
// The smtp package is frozen and is not accepting new features.
// Some external packages provide more functionality. See:
//
// https://godoc.org/?q=smtp
// https://pkg.go.dev/search?q=smtp
```
```
@ -31,5 +31,3 @@ To signal that a package is frozen and is not accepting new features, add a para
```
// The text/tabwriter package is frozen and is not accepting new features.
```
There are some examples [in the standard library](https://golang.org/search?q=frozen).

@ -27,8 +27,8 @@ Notes:
# Bundle data into Go binary
There are a lot of ways to bundle data in Go binary, for example:
* ` zip ` the data files, and append the zip file to end of Go binary, then use ` zip -A prog ` to adjust the bundled zip header. You can use ` archive/zip ` to open the program as a zip file, and access its contents easily. There are existing packages that helps with this, for example, https://godoc.org/bitbucket.org/tebeka/nrsc; This requires post-processing the program binary, which is not suitable for non-main packages that require static data. Also, you must collect all data files into one zip file, which means that it's impossible to use multiple packages that utilize this method.
* Embed the binary file as a ` string ` or ` []byte ` in Go program. This method is not recommended, not only because the generated Go source file is much larger than the binary files themselves, also because static large ` []byte ` slows down the compilation of the package and the ` gc ` compiler uses a lot of memory to compile it (this is a known bug of ` gc `). For example, see the [tools/godoc/static](https://godoc.org/golang.org/x/tools/godoc/static) package.
* ` zip ` the data files, and append the zip file to end of Go binary, then use ` zip -A prog ` to adjust the bundled zip header. You can use ` archive/zip ` to open the program as a zip file, and access its contents easily. There are existing packages that helps with this, for example, https://pkg.go.dev/bitbucket.org/tebeka/nrsc; This requires post-processing the program binary, which is not suitable for non-main packages that require static data. Also, you must collect all data files into one zip file, which means that it's impossible to use multiple packages that utilize this method.
* Embed the binary file as a ` string ` or ` []byte ` in Go program. This method is not recommended, not only because the generated Go source file is much larger than the binary files themselves, also because static large ` []byte ` slows down the compilation of the package and the ` gc ` compiler uses a lot of memory to compile it (this is a known bug of ` gc `). For example, see the [tools/godoc/static](https://pkg.go.dev/golang.org/x/tools/godoc/static) package.
* use similar ` syso ` technique to bundle the data. Precompile the data file as syso file using GNU ` as(1) `'s ` .incbin ` pseudo-instruction.
The key trick for the 3rd alternative is that the linker for the ` gc ` toolchain has the ability to link COFF object files of a different architecture into the binary without problem, so you don't need to provide syso files for all supported architectures. As long as the syso file doesn't contain instructions, you can just use one to embed the data.

@ -62,7 +62,7 @@ Code changed to use the existing proposal.
Critiques without counter-proposals
- Pasha Osipyants, “[Error handling mechanism using current go possibilities](https://godoc.org/github.com/pashaosipyants/errors)”, February 2019
- Pasha Osipyants, “[Error handling mechanism using current go possibilities](https://pkg.go.dev/github.com/pashaosipyants/errors)”, February 2019
- Anonymous, “[Go 2 Error Handling Non-Proposal](https://groups.google.com/d/topic/golang-nuts/1McP4_-oOpo/discussion)”, October 2018

@ -12,7 +12,7 @@ As the amount of feedback grows, please feel free to organize this page by speci
### Draft Implementation
- Go Team, “[x/exp/errors](https://godoc.org/golang.org/x/exp/errors)”, November 2018
- Go Team, “[x/exp/errors](https://pkg.go.dev/golang.org/x/exp/errors)”, November 2018
- Torben Schinke, “[Implementation of the draft design](https://github.com/worldiety/errors)”, December 2018

@ -1,8 +1,8 @@
[`go generate`](https://blog.golang.org/generate) is only useful if you have tools to use it with! Here is an incomplete list of useful tools that generate code.
* [goyacc](https://godoc.org/golang.org/x/tools/cmd/goyacc) Yacc for Go.
* [stringer](https://godoc.org/golang.org/x/tools/cmd/stringer) Implements `fmt.Stringer` interface for enums.
* [gostringer](https://godoc.org/github.com/sourcegraph/gostringer) Implements `fmt.GoStringer` interface for enums.
* [goyacc](https://pkg.go.dev/golang.org/x/tools/cmd/goyacc) Yacc for Go.
* [stringer](https://pkg.go.dev/golang.org/x/tools/cmd/stringer) Implements `fmt.Stringer` interface for enums.
* [gostringer](https://pkg.go.dev/github.com/sourcegraph/gostringer) Implements `fmt.GoStringer` interface for enums.
* [jsonenums](https://github.com/campoy/jsonenums) Implements `json.Marshaler` and `json.Unmarshaler` interfaces for enums.
* [go-syncmap](https://pkg.go.dev/github.com/searKing/golang/tools/cmd/go-syncmap) - Generates Go code using a package as a generic template for `sync.Map`.
* [go-syncpool](https://pkg.go.dev/github.com/searKing/golang/tools/cmd/go-syncpool) - Generates Go code using a package as a generic template for `sync.Pool`.
@ -17,7 +17,7 @@
* [embedfiles](https://4d63.com/embedfiles) - Embeds files into Go code.
* [ragel](https://www.colm.net/open-source/ragel/) - State machine compiler
* [peachpy](https://github.com/Maratyszcza/PeachPy) - x86-64 assembler embedded in Python, generates Go assembly
* [bundle](https://godoc.org/golang.org/x/tools/cmd/bundle) - Bundle creates a single-source-file version of a source package suitable for inclusion in a particular target package.
* [bundle](https://pkg.go.dev/golang.org/x/tools/cmd/bundle) - Bundle creates a single-source-file version of a source package suitable for inclusion in a particular target package.
* [msgp](https://github.com/tinylib/msgp) - A Go code generator for MessagePack
* [protobuf](https://github.com/golang/protobuf) - protobuf
* [thriftrw](https://github.com/thriftrw/thriftrw-go) - thrift

@ -52,7 +52,7 @@ Ready to write some Go code of your own? Here are a few links to help you get st
- [Tools for working with Go code](CodeTools) - Formatting, linting, vetting, refactoring, navigation, and visualization.
- Finding Go Libraries and Packages
- Start here: [Go open source projects](Projects).
- Search for Go packages: [godoc.org](http://godoc.org)
- Search for Go packages: [pkg.go.dev](http://pkg.go.dev)
- Visualization of the [Go open-source package graph](https://anvaka.github.io/pm/#/galaxy/gosearch?l=1)
- [Modules](Modules) - documentation on the dependency management system built into the Go command, added in 1.11.
- [Managing your dependencies](PackageManagementTools) - An overview of the tools you can use to manage third-party packages (vendoring).

@ -93,28 +93,28 @@ If you decide you need a bit more infrastructure, start by looking at some of th
- Read [Go, Cloud Endpoints and App Engine, Part 1](https://medium.com/google-cloud/go-cloud-endpoints-and-app-engine-19d290dafda3), [Part 2](https://medium.com/@IndianGuru/go-cloud-endpoints-and-app-engine-e3413c01c484)
- Read [Google Cloud Platform: Go Runtime Environment](https://cloud.google.com/appengine/docs/go/)
- Watch [Go and the Google Cloud Platform](http://blog.golang.org/go-and-google-cloud-platform)
- Read [Go on App Engine: tools, tests, and concurrency](http://blog.golang.org/appengine-dec2013)
- Get [Google Cloud Platform Go Libraries](http://godoc.org/google.golang.org/cloud)
- Read [Deploying Go servers with Docker](http://blog.golang.org/docker)
- Search packages for [Google Cloud](http://godoc.org/?q=google+cloud) or [gcloud](http://godoc.org/?q=gcloud)
- Search packages for [App Engine](http://godoc.org/?q=appengine) or [GAE](http://godoc.org/?q=gae)
- Watch [Go and the Google Cloud Platform](https://go.dev/blog/go-and-google-cloud-platform)
- Read [Go on App Engine: tools, tests, and concurrency](https://go.dev/blog/appengine-dec2013)
- Get [Google Cloud Platform Go Libraries](https://pkg.go.dev/google.golang.org/cloud)
- Read [Deploying Go servers with Docker](https://go.dev/blog/docker)
- Search packages for [Google Cloud](https://pkg.go.dev/search?q=google+cloud) or [gcloud](https://pkg.go.dev/search?q=gcloud)
- Search packages for [App Engine](https://pkg.go.dev/search?q=appengine) or [GAE](https://pkg.go.dev/search?q=gae)
### Amazon Web Services
- The [aws-sdk-go](https://github.com/aws/aws-sdk-go) repository provides automatically generated AWS clients in Go. It has [official support](https://aws.amazon.com/blogs/aws/now-available-version-1-0-of-the-aws-sdk-for-go/) from Amazon.
- [Package goamz](https://wiki.ubuntu.com/goamz) enables Go programs to interact with the Amazon Web Services.
- Search packages for [AWS](http://godoc.org/?q=aws) or [Amazon services](http://godoc.org/?q=amazon+service)
- Search packages for [AWS](https://pkg.go.dev/search?q=aws) or [Amazon services](https://pkg.go.dev/search?q=amazon+service)
### Microsoft Azure
- Microsoft OpenTech's [azure-sdk-for-go](https://github.com/MSOpenTech/azure-sdk-for-go) provides a Golang package that makes it easy to consume and manage Microsoft Azure Services.
- Search packages for [Azure](http://godoc.org/?q=azure)
- Search packages for [Azure](http://pkg.go.dev/search?q=azure)
### Openstack / Rackspace
- [Gophercloud](https://github.com/gophercloud/gophercloud) is a Golang SDK for working with OpenStack clouds.
- Search packages for [Openstack](http://godoc.org/?q=openstack) or [Rackspace](http://godoc.org/?q=rackspace)
- Search packages for [Openstack](https://pkg.go.dev/search?q=openstack) or [Rackspace](https://pkg.go.dev/search?q=rackspace)
### IBM BlueMix

@ -47,7 +47,7 @@ The following sections will help you how to use the `gomobile` tool.
## Native applications
The native category includes applications entirely written in Go. Currently, the
[golang.org/x/mobile](https://godoc.org/golang.org/x/mobile)
[golang.org/x/mobile](https://pkg.go.dev/golang.org/x/mobile)
contains only a small set of packages that focus on:
* App control and configuration
@ -125,7 +125,7 @@ The advantages to following this strategy:
Current limitations are listed below.
* Only a [subset of Go types](https://godoc.org/golang.org/x/mobile/cmd/gobind) are currently supported.
* Only a [subset of Go types](https://pkg.go.dev/golang.org/x/mobile/cmd/gobind) are currently supported.
* Language bindings have a performance overhead.
* There are a few limitations on how the exported APIs should look due to the limitations of the target language.

@ -1148,7 +1148,7 @@ However, there is additional nuance beyond those two examples. Please read the F
Two example scenarios where it can make sense to have more than one `go.mod` in a repository:
1. if you have usage examples where the examples themselves have a complex set of dependencies (e.g., perhaps you have a small package but include an example of using your package with kubernetes). In that case, it can make sense for your repository to have an `example` or `_example` directory with its own `go.mod`, such as shown [here](https://godoc.org/github.com/loov/hrtime).
1. if you have usage examples where the examples themselves have a complex set of dependencies (e.g., perhaps you have a small package but include an example of using your package with kubernetes). In that case, it can make sense for your repository to have an `example` or `_example` directory with its own `go.mod`, such as shown [here](https://pkg.go.dev/github.com/loov/hrtime).
2. if you have a repository with a complex set of dependencies, but you have a client API with a smaller set of dependencies. In some cases, it might make sense to have an `api` or `clientapi` or similar directory with its own `go.mod`, or to separate out that `clientapi` into its own repository.

@ -1,5 +1,5 @@
# Introduction
Now that you've spent many hours writing your package and debugging it and testing it (you did [[test it|TableDrivenTests]], didn't you?), you want to publish it so other people can [go get](http://golang.org/cmd/go/) your package and see it on the [dashboard](https://godoc.org/).
Now that you've spent many hours writing your package and debugging it and testing it (you did [[test it|TableDrivenTests]], didn't you?), you want to publish it so other people can [go get](http://golang.org/cmd/go/) your package.
First, you will need to host it online somewhere. Three major code hosting sites are [bitbucket](http://bitbucket.org/) (hg/git), [GitHub](http://github.com/) (git) and [launchpad](http://launchpad.net) (bzr). I recommend choosing whichever version control system you are familiar with or which your code is versioned locally on your machine. Git (git) is the version control system used by the central Go repository, so it is the closest to a guarantee as you can get that a developer wanting to use your project will have the right software. If you have never used version control before, these websites have some nice HOWTOs and you can find many great tutorials by searching Google for "{name} tutorial" where {name} is the name of the version control system you would like to learn.
@ -127,4 +127,4 @@ The Go Dashboard will use the first line of your package-level comment (also usi
package epub
```
For more information on godoc, see the [Documenting Go Code](http://blog.golang.org/2011/03/godoc-documenting-go-code.html) blog post.
For more information on godoc, see the [Documenting Go Code](http://blog.golang.org/2011/03/godoc-documenting-go-code.html) blog post.

@ -187,7 +187,7 @@ If you find a project in this list that is dead or broken, please either mark it
* [go-getoptions](https://github.com/DavidGamba/go-getoptions) - Go option parser inspired on the flexibility of Perl s GetOpt::Long.
* [goopt](https://github.com/droundy/goopt) - a getopt clone to parse command-line flags
* [go-options](https://github.com/gaal/go-options) - A command line parsing library for Go
* [`mellium.im/cli`](https://godoc.org/mellium.im/cli) A library for parsing modern CLI apps including subcommands that may have their own flags and a built in help system. Designed to use a minimal API.
* [`mellium.im/cli`](https://pkg.go.dev/mellium.im/cli) A library for parsing modern CLI apps including subcommands that may have their own flags and a built in help system. Designed to use a minimal API.
* [options](https://github.com/fd/options/) - Self documenting CLI options parser
* [opts.go](http://opts-go.googlecode.com/) - lightweight POSIX- and GNU- style option parsing
* [pflag](https://github.com/ogier/pflag) - Drop-in replacement for Go's flag package, implementing POSIX/GNU-style --flags.
@ -295,7 +295,7 @@ If you find a project in this list that is dead or broken, please either mark it
* [lib/ssh/config](https://pkg.go.dev/github.com/shuLhan/share/lib/ssh/config) - Package config provide the ssh_config(5) parser and getter.
* [nestext](https://github.com/npillmayer/nestext) - Package nestext provides tools for processing NestedText, a human friendly data format.
* [properties](https://github.com/magiconair/properties) - Library for reading and writing properties files
* [scribeconf](https://godoc.org/github.com/fumin/scribeconf) - Facebook Scribe server configuration file parser
* [scribeconf](https://pkg.go.dev/github.com/fumin/scribeconf) - Facebook Scribe server configuration file parser
* [toml](http://github.com/mojombo/toml):
* [go-toml-config](http://github.com/stvp/go-toml-config) - TOML-based config for Go
* [go-toml](http://github.com/pelletier/go-toml) - Go library for the TOML language
@ -424,7 +424,7 @@ If you find a project in this list that is dead or broken, please either mark it
* [skip](https://github.com/glenn-brown/skiplist) - A fast position-addressable ordered map and multimap.
* [Skiplist](https://github.com/glenn-brown/skiplist) - A fast indexable ordered multimap.
* [skiplist](https://github.com/huandu/skiplist) - A skip list implementation. Highly customizable and easy to use.
* [skiplist](https://godoc.org/github.com/fumin/skiplist) - Skiplist data structure ported from Redis's Sorted Sets.
* [skiplist](https://pkg.go.dev/github.com/fumin/skiplist) - Skiplist data structure ported from Redis's Sorted Sets.
* [stackgo](https://github.com/alediaferia/stackgo) - A fast slice-based stack implementation.
### Queues
@ -739,7 +739,6 @@ See also [[SQLDrivers page|SQLDrivers]].
* [examplgen](https://github.com/gima/examplgen) - Insert code from .go files to documents (examples to project's readme, for instance).
* [godocdown](https://github.com/robertkrimen/godocdown) - Format package documentation (godoc) as GitHub friendly Markdown
* [GoDoc.org](http://godoc.org/) - GoDoc.org generates documentation on the fly from source on Bitbucket, Github, Google Project Hosting and Launchpad.
* [golangdoc](https://github.com/golang-china/golangdoc) - Godoc for Golang, support translate.
* [Mango](http://code.google.com/p/mango-doc/) - Automatically generate unix man pages from Go sources
* [redoc](https://github.com/simonz05/redoc) - Commands documentation for Redis
@ -880,8 +879,8 @@ See also [[SQLDrivers page|SQLDrivers]].
* [cpio](https://github.com/cavaliergopher/cpio) - Readers and writers for the CPIO archive file format.
* [draw2d](https://github.com/llgcode/draw2d) - This package provide an API to draw 2d geometrical form on images. This library is largely inspired by postscript, cairo, HTML5 canvas.
* [ebiten](https://ebiten.org/) - A cross platform open-source game library with which you can develop 2D games with simple API for multi platforms. Cgo/c compiler setup not needed.
* [egl](http://godoc.org/github.com/mortdeus/egles/egl) - egl bindings
* [es2](http://godoc.org/github.com/mortdeus/egles/es2) - es2 bindings
* [egl](https://pkg.go.dev/github.com/mortdeus/egles/egl) - egl bindings
* [es2](https://pkg.go.dev/github.com/mortdeus/egles/es2) - es2 bindings
* [fastgallery](https://github.com/tonimelisma/fastgallery) - A fast static image and video web gallery generator
* [fourcc](https://github.com/reiver/go-fourcc) - Go implementation of FOURCC (four character code) (4CC) identifiers for a video codecs, compression formats, colors, and pixel format used in media files.
* [freetype-go](http://code.google.com/p/freetype-go/) - a Go implementation of FreeType
@ -1086,7 +1085,7 @@ See also [[SQLDrivers page|SQLDrivers]].
* [gini](https://github.com/irifrance/gini) - SAT Solver/Boolean Logic Tools
* [gochipmunk](https://github.com/paulcoyle/gochipmunk) - Go bindings to the Chipmunk Physics library
* [gocomplex](http://code.google.com/p/gocomplex/) - a complex number library
* [godec](http://godoc.org/speter.net/go/exp/math/dec/inf) - multi-precision decimal arithmetic
* [godec](https://pkg.go.dev/speter.net/go/exp/math/dec/inf) - multi-precision decimal arithmetic
* [gofd](https://bitbucket.org/gofd/gofd) - concurrent finite domain constraint solver.
* [go-fftw](https://github.com/runningwild/go-fftw) - Go bindings for FFTW - The Fastest Fourier Transform in the West
* [go-fn](https://code.google.com/p/go-fn/) - Special functions that would not fit in "math" pkg
@ -1097,14 +1096,14 @@ See also [[SQLDrivers page|SQLDrivers]].
* [go-lm](https://github.com/awblocker/go-lm) - Linear models in Go. Provides WLS and regression with t residuals via a cgo -> BLAS/LAPACK interface.
* [go.mahalanobis](https://github.com/ant0ine/go.mahalanobis) - Naive implementation of the Mahalanobis distance using go.matrix
* [gomat](http://code.google.com/p/gomat/) - lightweight FAST matrix and vector math
* [go\_matrix\_cuda](https://godoc.org/github.com/alonsovidales/go_matrix_cuda) - GPU-Accelerated Linear Algebra Libraries based in CUDA
* [go\_matrix\_cuda](https://pkg.go.dev/github.com/alonsovidales/go_matrix_cuda) - GPU-Accelerated Linear Algebra Libraries based in CUDA
* [go.matrix](https://github.com/skelterjohn/go.matrix) - a linear algebra package
* [gonum](https://github.com/gonum) - Scientific packages (linear algebra, BLAS, LAPACK, differentiation, plots, linear programming, statistics, ...)
* [go-symexpr](https://github.com/verdverm/go-symexpr) - Symbolic math as an AST with derivatives, simplification, and non-linear regression
* [gsl](https://bitbucket.org/mingzhi/gsl) - GNU Scientific Library bindings
* [humanize](https://bitbucket.org/dchapes/humanize) - formats large numbers into human readable small numbers
* [interval](http://godoc.org/github.com/cznic/interval) - Package interval handles sets of ordered values laying between two, possibly infinite, bounds.
* [mathutil](http://godoc.org/github.com/cznic/mathutil) - Package mathutil provides utilities supplementing the standard 'math' and 'rand' packages.
* [interval](https://pkg.go.dev/github.com/cznic/interval) - Package interval handles sets of ordered values laying between two, possibly infinite, bounds.
* [mathutil](https://pkg.go.dev/github.com/cznic/mathutil) - Package mathutil provides utilities supplementing the standard 'math' and 'rand' packages.
* [mt19937\_64](https://github.com/farces/mt19937_64) - Mersenne Twister int64 random source
* [permutation](https://github.com/weatherglass/pkg/tree/master/permutation) - Package permutation generates permutations of the indices of a slice
* [polyclip.go](https://github.com/akavel/polyclip.go) - Go implementation of algorithm for Boolean operations on 2D polygons
@ -1168,7 +1167,7 @@ See also [[SQLDrivers page|SQLDrivers]].
* [go-eco](https://code.google.com/p/go-eco/) - Functions for use in ecology
* [go-erx](https://github.com/StepLg/go-erx) - Extended error reporting library
* [go-eventsocket](https://github.com/fiorix/go-eventsocket) - An event socket client/server library for the [FreeSWITCH](https://freeswitch.org) telephony platform.
* [GoFakeIt](http://godoc.org/github.com/brianvoe/gofakeit) - Fake Data Generator. 65+ different variations and examples for each
* [GoFakeIt](https://pkg.go.dev/github.com/brianvoe/gofakeit) - Fake Data Generator. 65+ different variations and examples for each
* [go-fann](https://github.com/white-pony/go-fann) - Go bindings for FANN, library for artificial neural networks
* [GoFlow](https://github.com/trustmaster/goflow) - Flow-based and dataflow programming library for Go
* [goga](https://github.com/rrs/goga) - A genetic algorithm framework
@ -1262,7 +1261,7 @@ See also [[SQLDrivers page|SQLDrivers]].
* [GeoDNS](https://github.com/abh/geodns) - geo-aware authoritative DNS server
* [grong](https://github.com/bortzmeyer/grong) - Small authoritative DNS name server
* [hostsfile](https://github.com/jaytaylor/go-hostsfile) - /etc/hostsfile reverse lookup IP => names
* [lib/dns](https://godoc.org/github.com/shuLhan/share/lib/dns) - The DNS library for client or server with support UDP, TCP, and DNS over HTTPS
* [lib/dns](https://pkg.go.dev/github.com/shuLhan/share/lib/dns) - The DNS library for client or server with support UDP, TCP, and DNS over HTTPS
* [mdns](https://github.com/davecheney/mdns/) - Multicast DNS library for Go
* [rescached](https://github.com/shuLhan/rescached-go/) - DNS resolver cache daemon
@ -1308,7 +1307,7 @@ See also [[SQLDrivers page|SQLDrivers]].
* [hanu](https://github.com/sbstjn/hanu) - Framework for writing Slack bots
* [ircflu](https://github.com/muesli/ircflu) - IRC bot with support for commands, scripting and web-hooks
* [irc.go](http://code.google.com/p/go-bot/source/browse/irc.go) - Go IRC bot framework
* [`mellium.im/xmpp`](https://godoc.org/mellium.im/xmpp) a low-level XMPP client and server library focusing on good documentation and a clean, usable API
* [`mellium.im/xmpp`](https://pkg.go.dev/mellium.im/xmpp) a low-level XMPP client and server library focusing on good documentation and a clean, usable API
* [sirius](https://github.com/ortuman/sirius) - [link is broken] A fast and ultra-lightweight chat server written in Go
* [xmpp-client](https://github.com/agl/xmpp-client) - an XMPP client with OTR (off-the-record) support
@ -1341,7 +1340,7 @@ See also [[SQLDrivers page|SQLDrivers]].
### Websockets
* [Gorilla WebSocket](https://github.com/gorilla/websocket) - WebSocket protocol implementation
* [lib/websocket](https://godoc.org/github.com/shuLhan/share/lib/websocket) - A library for writing websocket client and server (using epoll)
* [lib/websocket](https://pkg.go.dev/github.com/shuLhan/share/lib/websocket) - A library for writing websocket client and server (using epoll)
* [websocketd](https://github.com/joewalnes/websocketd) - HTTP server that converts STDIN/STDOUT program into WebSockets service. Also handles HTML and CGI.
* [ws-cli](https://github.com/kseo/ws-cli) - WebSocket command line client
* [wst](https://github.com/jthestupidkid/wst) - A dead simple WebSocket tester

@ -2,8 +2,8 @@
To limit the rate of operations per unit time, use a [time.Ticker](http://golang.org/pkg/time/#NewTicker).
This works well for rates up to tens of operations per second.
For higher rates, prefer a token bucket rate limiter such as [golang.org/x/time/rate.Limiter](https://godoc.org/golang.org/x/time/rate) (also search godoc.org for
[rate limit](http://godoc.org/?q=rate+limit)).
For higher rates, prefer a token bucket rate limiter such as [golang.org/x/time/rate.Limiter](https://pkg.go.dev/golang.org/x/time/rate) (also search pkg.go.dev for
[rate limit](http://pkg.go.dev/search?q=rate+limit)).
```go
import "time"

@ -93,7 +93,7 @@ This page lists academic and industry research papers about Go or using Go as th
- ProIO: An Event-Based I/O Stream Format for Protobuf Messages (D. Blyth, J. Alcaraz, S. Binet, S.V. Chekanov)
- [arXiv:1812.03967](https://arxiv.org/abs/1812.03967)
- [proio-org/go-proio](https://godoc.org/github.com/proio-org/go-proio)
- [proio-org/go-proio](https://pkg.go.dev/github.com/proio-org/go-proio)
- The latest gossip on BFT consensus (Buchman, Kwon, Milosevic)
- [pdf](https://arxiv.org/abs/1807.04938)
@ -175,7 +175,7 @@ our implementation sticker (Aoshima, 2018) written in Golang (Golang, 2009)..."_
- [DOI: 10.1186/s13326-017-0136-y](https://doi.org/10.1186/s13326-017-0136-y)
- The rdf2smw commandline tool, for batch conversion from RDF to Semantic MediaWiki facts in MediaWiki XML dump format, is written in Go
- [github.com/rdfio/rdf2smw](https://github.com/rdfio/rdf2smw)
- [godoc](https://godoc.org/github.com/rdfio/rdf2smw)
- [godoc](https://pkg.go.dev/github.com/rdfio/rdf2smw)
- Keywords: Semantic MediaWiki, Semantic Web, RDF
- Construction and first tests of an in-beam PET demonstrator dedicated to the ballistic control of hadrontherapy treatments with 65 MeV protons (E Busato et al.) IEEE Transactions on Radiation and Plasma Medical Sciences ( Volume: PP, Issue: 99 )
- [DOI: 10.1109/TRPMS.2017.2780447](https://doi.org/10.1109/TRPMS.2017.2780447)
@ -186,7 +186,7 @@ our implementation sticker (Aoshima, 2018) written in Golang (Golang, 2009)..."_
- Keywords: Data-driven, Programming language, Multi-threading
- Estimating Mixture Entropy with Pairwise Distances (Artemy Kolchinsky, Brendan D. Tracey)
- [arXiv](https://arxiv.org/abs/1706.02419)
- [godoc](https://godoc.org/github.com/btracey/mixent)
- [godoc](https://pkg.go.dev/github.com/btracey/mixent)
- Towards Omnia: a Monitoring Factory for Quality-Aware DevOps (Marco Miglierina, Damian A. Tamburri)
- [doi.org/10.1145/3053600.3053629](https://doi.org/10.1145/3053600.3053629) ICPE '17 Companion
- [github.com/mmiglier/omnia](https://github.com/mmiglier/omnia) (Go: 52.8% )

@ -93,7 +93,7 @@ some/lib@v1.3.0 some-other/lib@v2.4.7
some/lib@v1.3.0 github.com/golang/lint@v0.0.0-20180702182130-06c8688daad7
```
Visualized with [golang.org/x/exp/cmd/modgraphviz](https://godoc.org/golang.org/x/exp/cmd/modgraphviz):
Visualized with [golang.org/x/exp/cmd/modgraphviz](https://pkg.go.dev/golang.org/x/exp/cmd/modgraphviz):
![A Module Dependency Graph With Trailing History](https://github.com/jadekler/module-testing/blob/master/imagery/graph1.png)

@ -41,7 +41,7 @@ Drivers for Go's sql package include:
* **Oracle** (uses cgo): https://gopkg.in/rana/ora.v4
* **Oracle** (uses cgo): https://github.com/godror/godror
* **Oracle** (pure go): https://github.com/sijms/go-ora
* **QL**: http://godoc.org/github.com/cznic/ql/driver
* **QL**: https://pkg.go.dev/github.com/cznic/ql/driver
* **Postgres** (pure Go): https://github.com/lib/pq ` [*] `
* **Postgres** (uses cgo): https://github.com/jbarham/gopgsqldriver
* **Postgres** (pure Go): https://github.com/jackc/pgx ` [*] `
@ -62,10 +62,10 @@ Drivers for Go's sql package include:
* **Sybase ASE** (pure go): https://github.com/thda/tds
* **TiDB**: Use any MySQL driver
* **Vertica**: https://github.com/vertica/vertica-sql-go
* **Vitess**: https://godoc.org/vitess.io/vitess/go/vt/vitessdriver
* **Vitess**: https://pkg.go.dev/vitess.io/vitess/go/vt/vitessdriver
* **YQL (Yahoo! Query Language)**: https://github.com/mattn/go-yql
* **Apache Hive**: https://github.com/sql-machine-learning/gohive
* **MaxCompute**: https://github.com/sql-machine-learning/gomaxcompute
Drivers marked with ` [*] ` are both included in and pass the compatibility test suite at https://github.com/bradfitz/go-sql-test.
Drivers marked with ` [**] ` pass the compatibility test suite but are not currently included in it.
Drivers marked with ` [*] ` are both included in and pass the compatibility test suite at https://github.com/bradfitz/go-sql-test.
Drivers marked with ` [**] ` pass the compatibility test suite but are not currently included in it.

@ -196,7 +196,7 @@ for left, right := 0, len(a)-1; left < right; left, right = left+1, right-1 {
FisherYates algorithm:
> Since go1.10, this is available at [math/rand.Shuffle](https://godoc.org/math/rand#Shuffle)
> Since go1.10, this is available at [math/rand.Shuffle](https://pkg.go.dev/math/rand#Shuffle)
```go
for i := len(a) - 1; i > 0; i-- {

@ -61,10 +61,10 @@ The same rule applies to arrays and maps.
If your struct needs to be compared for approximate equality or some other
kind of semantic equality, or it contains fields that cannot be compared for
equality (e.g. if one of the fields is an `io.Reader`), tweaking a
[`cmp.Diff`](https://godoc.org/github.com/google/go-cmp/cmp#Diff) or
[`cmp.Equal`](https://godoc.org/github.com/google/go-cmp/cmp#Equal) comparison
with [cmpopts](https://godoc.org/github.com/google/go-cmp/cmp/cmpopts) options
such as [`cmpopts.IgnoreInterfaces`](https://godoc.org/github.com/google/go-cmp/cmp/cmpopts#IgnoreInterfaces)
[`cmp.Diff`](https://pkg.go.dev/github.com/google/go-cmp/cmp#Diff) or
[`cmp.Equal`](https://pkg.go.dev/github.com/google/go-cmp/cmp#Equal) comparison
with [cmpopts](https://pkg.go.dev/github.com/google/go-cmp/cmp/cmpopts) options
such as [`cmpopts.IgnoreInterfaces`](https://pkg.go.dev/github.com/google/go-cmp/cmp/cmpopts#IgnoreInterfaces)
may meet your needs ([example](https://play.golang.org/p/vrCUNVfxsvF));
otherwise, this technique just won't work, so do whatever works.
@ -97,9 +97,9 @@ Values it can compare include numeric, string, and pointer values and structs
with fields of those values. In particular, it determines two pointers to be
equal only if they point to the same variable.
Use the [cmp](https://godoc.org/github.com/google/go-cmp/cmp) package. Use
[`cmp.Equal`](https://godoc.org/github.com/google/go-cmp/cmp#Equal) for equality
comparison and [`cmp.Diff`](https://godoc.org/github.com/google/go-cmp/cmp#Diff)
Use the [cmp](https://pkg.go.dev/github.com/google/go-cmp/cmp) package. Use
[`cmp.Equal`](https://pkg.go.dev/github.com/google/go-cmp/cmp#Equal) for equality
comparison and [`cmp.Diff`](https://pkg.go.dev/github.com/google/go-cmp/cmp#Diff)
to obtain a human-readable diff between objects.
Although the `cmp` package is not part of the Go standard library, it is
@ -187,7 +187,7 @@ A test helper is a function that performs a setup or teardown task, such as
constructing an input message, that does not depend on the code under test.
If you pass a `*testing.T`, call
[`t.Helper`](https://godoc.org/testing#T.Helper) to attribute failures in the
[`t.Helper`](https://pkg.go.dev/testing#T.Helper) to attribute failures in the
test helper to the line where the helper is called.
```go

@ -53,7 +53,7 @@ $ GOOS=js GOARCH=wasm go build -o main.wasm
That will build the package and produce an executable WebAssembly
module file named main.wasm. The .wasm file extension will make it
easier to serve it over HTTP with the correct Content-Type header
later on.
later on.
Note that you can only compile main packages. Otherwise, you will get an object file that cannot be run in WebAssembly. If you have a package that you want to be able to use with WebAssembly, convert it to a main package and build a binary.
@ -96,9 +96,9 @@ https://github.com/shurcooL/goexec#goexec[`goexec`]:
$ goexec 'http.ListenAndServe(`:8080`, http.FileServer(http.Dir(`.`)))'
```
Or use your own https://play.golang.org/p/pZ1f5pICVbV[basic HTTP server command].
Or use your own https://play.golang.org/p/pZ1f5pICVbV[basic HTTP server command].
Note: for the `goexec` command to work on Unix-like systems, you must https://golang.org/doc/install#tarball[add the path environment variable] for Go to your shell's `profile`. Go's getting started guide explains this:
Note: for the `goexec` command to work on Unix-like systems, you must https://golang.org/doc/install#tarball[add the path environment variable] for Go to your shell's `profile`. Go's getting started guide explains this:
> Add /usr/local/go/bin to the PATH environment variable. You can do this by adding this line to your /etc/profile (for a system-wide installation) or $HOME/.profile:
@ -169,7 +169,7 @@ $ GOOS=js GOARCH=wasm go test -exec="$GOPATH/bin/wasmbrowsertest"
# Interacting with the DOM
See https://godoc.org/syscall/js.
See https://pkg.go.dev/syscall/js.
Also:
@ -326,7 +326,7 @@ There are two main ways (for now) to reduce this file size:
1. Manually compress the .wasm file.
a. Using `gz` compression reduces the ~2MB (minimum file size) example WASM file down to around 500kB. It may be better to use https://github.com/google/zopfli[Zopfli] to do the gzip compression, as it gives better results than `gzip --best`, however it does take much longer to run.
b. Using https://github.com/google/brotli[Brotli] for compression, the file sizes are markedly better than both Zopfli and `gzip --best`, and compression time is somewhere in between the two, too. This https://github.com/andybalholm/brotli[(new) Brotli compressor] looks reasonable.
b. Using https://github.com/google/brotli[Brotli] for compression, the file sizes are markedly better than both Zopfli and `gzip --best`, and compression time is somewhere in between the two, too. This https://github.com/andybalholm/brotli[(new) Brotli compressor] looks reasonable.
Examples from https://github.com/johanbrandhorst[@johanbrandhorst]
@ -364,4 +364,4 @@ This project is also very actively developed, so its capabilities are expanding
# Other WebAssembly resources
* https://github.com/mbasso/awesome-wasm[Awesome-Wasm] - An extensive list of further Wasm resources. Not Go specific.
* https://github.com/mbasso/awesome-wasm[Awesome-Wasm] - An extensive list of further Wasm resources. Not Go specific.

@ -1,24 +1,24 @@
# Well-known struct tags
## Background
Go offers [struct tags](https://golang.org/ref/spec#Tag) which are discoverable via reflection. These enjoy a wide range of use in the standard library in the JSON/XML and other encoding packages.
Go offers [struct tags](https://golang.org/ref/spec#Tag) which are discoverable via reflection. These enjoy a wide range of use in the standard library in the JSON/XML and other encoding packages.
The community welcomed them and has built ORMs, further encodings, flag parsers and much more around them since, especially for these tasks, single-sourcing is beneficial for data structures.
## Problem description
Due to increased usage of Go and thus Go [struct tags](https://golang.org/ref/spec#Tag), clashes become inevitable.
Due to increased usage of Go and thus Go [struct tags](https://golang.org/ref/spec#Tag), clashes become inevitable.
## Solution
The list below is a best effort to document well-known struct tags used by packages which are available to the public.
## Format of the list
* Struct tag as extracted by calling https://godoc.org/reflect#StructTag.Get with this tag as the `key` argument.
* Documentation link of this package using https://godoc.org
* Struct tag as extracted by calling https://pkg.go.dev/reflect#StructTag.Get with this tag as the `key` argument.
* Documentation link of this package using https://pkg.go.dev
### Example entry
Tag | Documentation
----|-----
xml | https://godoc.org/encoding/xml
xml | https://pkg.go.dev/encoding/xml
### Change Management
List entries can be added by anyone who creates a public package where a new tag is used.
@ -27,24 +27,22 @@ List entries can be removed when the links to the package documentation stops wo
## List of well-known struct tags
Tag | Documentation
----------|---------------
xml | https://godoc.org/encoding/xml
json | https://godoc.org/encoding/json
asn1 | https://godoc.org/encoding/asn1
reform | https://godoc.org/gopkg.in/reform.v1
xml | https://pkg.go.dev/encoding/xml
json | https://pkg.go.dev/encoding/json
asn1 | https://pkg.go.dev/encoding/asn1
reform | https://pkg.go.dev/gopkg.in/reform.v1
dynamodb | https://docs.aws.amazon.com/sdk-for-go/api/service/dynamodb/dynamodbattribute/#Marshal
bigquery | https://godoc.org/cloud.google.com/go/bigquery
datastore | https://godoc.org/cloud.google.com/go/datastore
spanner | https://godoc.org/cloud.google.com/go/spanner
bson | https://godoc.org/labix.org/v2/mgo/bson, https://godoc.org/go.mongodb.org/mongo-driver/bson/bsoncodec
gorm | https://godoc.org/github.com/jinzhu/gorm
yaml | https://godoc.org/gopkg.in/yaml.v2
toml | https://godoc.org/github.com/pelletier/go-toml
bigquery | https://pkg.go.dev/cloud.google.com/go/bigquery
datastore | https://pkg.go.dev/cloud.google.com/go/datastore
spanner | https://pkg.go.dev/cloud.google.com/go/spanner
bson | https://pkg.go.dev/labix.org/v2/mgo/bson, https://pkg.go.dev/go.mongodb.org/mongo-driver/bson/bsoncodec
gorm | https://pkg.go.dev/github.com/jinzhu/gorm
yaml | https://pkg.go.dev/gopkg.in/yaml.v2
toml | https://pkg.go.dev/github.com/pelletier/go-toml
validate | https://github.com/go-playground/validator
mapstructure | https://godoc.org/github.com/mitchellh/mapstructure
parser | https://godoc.org/github.com/alecthomas/participle
mapstructure | https://pkg.go.dev/github.com/mitchellh/mapstructure
parser | https://pkg.go.dev/github.com/alecthomas/participle
protobuf | https://github.com/golang/protobuf
db | https://github.com/jmoiron/sqlx
url | https://github.com/google/go-querystring
feature | https://github.com/nikolaydubina/go-featureprocessing
<!-- I have decided to use/keep using godoc.org instead of pkg.go.dev since godoc.org can be set to redirect to pkg.go.dev -github.com/colourdelete -->

@ -23,4 +23,4 @@ Install them with "go get".
* [[docs](https://pkg.go.dev/golang.org/x/exp)] [[source](https://go.googlesource.com/exp)] ` golang.org/x/exp ` — experimental code (handle with care).
[List of all packages in sub-repositories](https://godoc.org/-/subrepo)
[List of all packages in sub-repositories](https://pkg.go.dev/golang.org/x)