From ddb58f2a774bb611e4a2f5ed07fe936e19752abb Mon Sep 17 00:00:00 2001
From: Hana
Date: Fri, 3 Sep 2021 09:56:26 -0400
Subject: all: replace the example repo import path
github.com/golang/example is actually a mirror
of go.googlesource.com/example
which hosts the golang.org/x/example module.
The path mismatches causes build failures.
This CL replaces github.com/golang/example with
golang.org/x/example when appropriate.
I think the use case in
_content/doc/articles/go_command.html is better
served with a repo in github.com or widely known
source hosting sites. Otherwise, the flow may be
confusing. So, I used github.com/golang/protobuf.
Also replaced godoc.org links with pkg.go.dev links.
Still not sure if the instructions in the old blog
posts and articles continue to work though.
For blog posts, I am not sure what to do -
there is historical merit in preserving old
contents (that's the point of blogs, isn't it?)
However, old, broken examples can be confusing
for new users. Keeping all blog posts up-to-date
isn't scalable either.
The gopath_code.html and go_command.html can be
confusing for users who use latest go.
I think we need to make them more clear that they
are obsolete or archive(?) them.
Change-Id: Iefe0cc94b0690dc52933ebce214104e94d9b6808
Reviewed-on: https://go-review.googlesource.com/c/website/+/347551
Trust: Hyang-Ah Hana Kim
Run-TryBot: Hyang-Ah Hana Kim
TryBot-Result: Go Bot
Reviewed-by: Russ Cox
Website-Publish: Russ Cox
---
_content/doc/gopath_code.html | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
(limited to '_content/doc/gopath_code.html')
diff --git a/_content/doc/gopath_code.html b/_content/doc/gopath_code.html
index 87891f1b..2ce9d305 100644
--- a/_content/doc/gopath_code.html
+++ b/_content/doc/gopath_code.html
@@ -76,7 +76,7 @@ bin/
hello # command executable
outyet # command executable
src/
- github.com/golang/example/
+ golang.org/x/example/
.git/ # Git repository metadata
hello/
hello.go # command source
@@ -538,13 +538,13 @@ revision control system such as Git or Mercurial. The go tool uses
this property to automatically fetch packages from remote repositories.
For instance, the examples described in this document are also kept in a
Git repository hosted at GitHub
-github.com/golang/example.
+golang.org/x/example.
If you include the repository URL in the package's import path,
go get will fetch, build, and install it automatically:
-$ go get github.com/golang/example/hello
+$ go get golang.org/x/example/hello
$ $GOPATH/bin/hello
Hello, Go examples!
@@ -565,7 +565,7 @@ tree should now look like this:
bin/
hello # command executable
src/
- github.com/golang/example/
+ golang.org/x/example/
.git/ # Git repository metadata
hello/
hello.go # command source
@@ -589,7 +589,7 @@ package, too.
-import "github.com/golang/example/stringutil"
+import "golang.org/x/example/stringutil"
--
cgit v1.3-6-g1900