diff options
author | 2020-02-12 17:42:20 -0800 | |
---|---|---|
committer | 2020-02-12 17:42:20 -0800 | |
commit | 57c408a3a0e69f1319b4092b6fac8dd838bf5e45 (patch) | |
tree | 7bcf6924ff6342f9d51bae494488dba6472f29fc | |
parent | 0f36fa322f7057b85d36bb81af7f32d589557449 (diff) | |
download | sally-57c408a3a0e69f1319b4092b6fac8dd838bf5e45.tar.gz sally-57c408a3a0e69f1319b4092b6fac8dd838bf5e45.tar.zst sally-57c408a3a0e69f1319b4092b6fac8dd838bf5e45.zip |
Update Godoc server to pkg.go.dev (#40)
Update our default Godoc server from `` to the shiny, new `https://pkg.go.dev/`
See https://github.com/uber-go/sally/issues/39, T4832833
-rw-r--r-- | CHANGELOG.md | 6 | ||||
-rw-r--r-- | README.md | 4 | ||||
-rw-r--r-- | config.go | 4 | ||||
-rw-r--r-- | config_test.go | 2 | ||||
-rw-r--r-- | handler_test.go | 16 |
5 files changed, 17 insertions, 15 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index 6584850..7a9a899 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,8 +6,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] ### Added -- Added support configuring the godoc.org instance used for documentation - links. +- Support configuring the godoc server used for documentation links. + +### Changed +- Updated default godoc server from `https://godoc.org` to `https://pkg.go.dev`. ## [1.0.1] - 2019-01-03 ### Fixed @@ -13,8 +13,8 @@ Create a YAML file with the following structure: ```yaml # This optional section configures godoc documentation linking. godoc: - # Instance of godoc.org used for documentation links. Defaults to godoc.org. - host: godoc.org + # Instance of godoc server used for documentation links. Defaults to pkg.go.dev. + host: pkg.go.dev url: google.golang.org packages: @@ -9,7 +9,7 @@ import ( yaml "gopkg.in/yaml.v2" ) -const _defaultGodocServer = "godoc.org" +const _defaultGodocServer = "pkg.go.dev" // Config represents the structure of the yaml file type Config struct { @@ -27,7 +27,7 @@ type Package struct { // ensureAlphabetical checks that the packages are listed alphabetically in the configuration. func ensureAlphabetical(data []byte) bool { - // A yaml.MapSlice perservers ordering of keys: https://godoc.org/gopkg.in/yaml.v2#MapSlice + // A yaml.MapSlice perservers ordering of keys: https://pkg.go.dev/gopkg.in/yaml.v2#MapSlice var c struct { Packages yaml.MapSlice `yaml:"packages"` } diff --git a/config_test.go b/config_test.go index ab1bb2d..bf64085 100644 --- a/config_test.go +++ b/config_test.go @@ -22,7 +22,7 @@ packages: config, err := Parse(path) assert.NoError(t, err) - assert.Equal(t, config.Godoc.Host, "godoc.org") + assert.Equal(t, config.Godoc.Host, "pkg.go.dev") assert.Equal(t, config.URL, "google.golang.org") pkg, ok := config.Packages["grpc"] diff --git a/handler_test.go b/handler_test.go index ab8cd67..978f62d 100644 --- a/handler_test.go +++ b/handler_test.go @@ -34,10 +34,10 @@ func TestPackageShouldExist(t *testing.T) { <head> <meta name="go-import" content="go.uber.org/yarpc git https://github.com/yarpc/yarpc-go"> <meta name="go-source" content="go.uber.org/yarpc https://github.com/yarpc/yarpc-go https://github.com/yarpc/yarpc-go/tree/master{/dir} https://github.com/yarpc/yarpc-go/tree/master{/dir}/{file}#L{line}"> - <meta http-equiv="refresh" content="0; url=https://godoc.org/go.uber.org/yarpc"> + <meta http-equiv="refresh" content="0; url=https://pkg.go.dev/go.uber.org/yarpc"> </head> <body> - Nothing to see here. Please <a href="https://godoc.org/go.uber.org/yarpc">move along</a>. + Nothing to see here. Please <a href="https://pkg.go.dev/go.uber.org/yarpc">move along</a>. </body> </html> `) @@ -58,10 +58,10 @@ func TestTrailingSlash(t *testing.T) { <head> <meta name="go-import" content="go.uber.org/yarpc git https://github.com/yarpc/yarpc-go"> <meta name="go-source" content="go.uber.org/yarpc https://github.com/yarpc/yarpc-go https://github.com/yarpc/yarpc-go/tree/master{/dir} https://github.com/yarpc/yarpc-go/tree/master{/dir}/{file}#L{line}"> - <meta http-equiv="refresh" content="0; url=https://godoc.org/go.uber.org/yarpc/"> + <meta http-equiv="refresh" content="0; url=https://pkg.go.dev/go.uber.org/yarpc/"> </head> <body> - Nothing to see here. Please <a href="https://godoc.org/go.uber.org/yarpc/">move along</a>. + Nothing to see here. Please <a href="https://pkg.go.dev/go.uber.org/yarpc/">move along</a>. </body> </html> `) @@ -75,10 +75,10 @@ func TestDeepImports(t *testing.T) { <head> <meta name="go-import" content="go.uber.org/yarpc git https://github.com/yarpc/yarpc-go"> <meta name="go-source" content="go.uber.org/yarpc https://github.com/yarpc/yarpc-go https://github.com/yarpc/yarpc-go/tree/master{/dir} https://github.com/yarpc/yarpc-go/tree/master{/dir}/{file}#L{line}"> - <meta http-equiv="refresh" content="0; url=https://godoc.org/go.uber.org/yarpc/heeheehee"> + <meta http-equiv="refresh" content="0; url=https://pkg.go.dev/go.uber.org/yarpc/heeheehee"> </head> <body> - Nothing to see here. Please <a href="https://godoc.org/go.uber.org/yarpc/heeheehee">move along</a>. + Nothing to see here. Please <a href="https://pkg.go.dev/go.uber.org/yarpc/heeheehee">move along</a>. </body> </html> `) @@ -90,10 +90,10 @@ func TestDeepImports(t *testing.T) { <head> <meta name="go-import" content="go.uber.org/yarpc git https://github.com/yarpc/yarpc-go"> <meta name="go-source" content="go.uber.org/yarpc https://github.com/yarpc/yarpc-go https://github.com/yarpc/yarpc-go/tree/master{/dir} https://github.com/yarpc/yarpc-go/tree/master{/dir}/{file}#L{line}"> - <meta http-equiv="refresh" content="0; url=https://godoc.org/go.uber.org/yarpc/heehee/hawhaw"> + <meta http-equiv="refresh" content="0; url=https://pkg.go.dev/go.uber.org/yarpc/heehee/hawhaw"> </head> <body> - Nothing to see here. Please <a href="https://godoc.org/go.uber.org/yarpc/heehee/hawhaw">move along</a>. + Nothing to see here. Please <a href="https://pkg.go.dev/go.uber.org/yarpc/heehee/hawhaw">move along</a>. </body> </html> `) |