aboutsummaryrefslogtreecommitdiff
path: root/blog
diff options
context:
space:
mode:
authorAgniva De Sarker <agnivade@yahoo.co.in>2018-04-03 11:52:19 +0530
committerBrad Fitzpatrick <bradfitz@golang.org>2018-04-14 19:30:04 +0000
commit327197e6b056fd5c2c733feceab7a7a195556dbc (patch)
treeb0a19447a4d2aeb8fb6ac211d4fe58195e355c15 /blog
parent8723cc7387521a38ae242937c34eb8e15055e484 (diff)
downloadgolang-x-tools-327197e6b056fd5c2c733feceab7a7a195556dbc.tar.gz
godoc,blog: perform minor cleanup
- Remove a stray comment which was no longer needed. The accompanying issue golang.org/issue/7524 was discussed and closed. - Combine 2 if conditions into a single if-else because length of a slice can never be negative. - Remove http links from golangOrgAbsLinkReplacer now that all links have been changed to https in the blog articles. Change-Id: I2fe2ec245b580a91760c9331e9626b367f1b6740 Reviewed-on: https://go-review.googlesource.com/107155 Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
Diffstat (limited to 'blog')
-rw-r--r--blog/blog.go3
-rw-r--r--blog/blog_test.go4
2 files changed, 2 insertions, 5 deletions
diff --git a/blog/blog.go b/blog/blog.go
index c26b6adbc..73c184d4b 100644
--- a/blog/blog.go
+++ b/blog/blog.go
@@ -27,11 +27,8 @@ import (
var (
validJSONPFunc = regexp.MustCompile(`(?i)^[a-z_][a-z0-9_.]*$`)
// used to serve relative paths when ServeLocalLinks is enabled.
- // TODO(agnivade): change blog article links to all have https.
golangOrgAbsLinkReplacer = strings.NewReplacer(
- `href="http://golang.org/pkg`, `href="/pkg`,
`href="https://golang.org/pkg`, `href="/pkg`,
- `href="http://golang.org/cmd`, `href="/cmd`,
`href="https://golang.org/cmd`, `href="/cmd`,
)
)
diff --git a/blog/blog_test.go b/blog/blog_test.go
index 90155fead..c84be2a71 100644
--- a/blog/blog_test.go
+++ b/blog/blog_test.go
@@ -15,10 +15,10 @@ func TestLinkRewrite(t *testing.T) {
output string
}{
{
- `For instance, the <a href="http://golang.org/pkg/bytes/" target="_blank">bytes package</a> from the standard library exports the <code>Buffer</code> type.`,
+ `For instance, the <a href="https://golang.org/pkg/bytes/" target="_blank">bytes package</a> from the standard library exports the <code>Buffer</code> type.`,
`For instance, the <a href="/pkg/bytes/" target="_blank">bytes package</a> from the standard library exports the <code>Buffer</code> type.`},
{
- `(The <a href="http://golang.org/cmd/gofmt/" target="_blank">gofmt command</a> has a <code>-r</code> flag that provides a syntax-aware search and replace, making large-scale refactoring easier.)`,
+ `(The <a href="https://golang.org/cmd/gofmt/" target="_blank">gofmt command</a> has a <code>-r</code> flag that provides a syntax-aware search and replace, making large-scale refactoring easier.)`,
`(The <a href="/cmd/gofmt/" target="_blank">gofmt command</a> has a <code>-r</code> flag that provides a syntax-aware search and replace, making large-scale refactoring easier.)`,
},
{