@@ -78,7 +78,7 @@ constant expressions, as we'll see in
7878
7979
8080
81- The [ ` golang.org/x/tools/go/loader ` package] ( https://godoc.org /golang.org/x/tools/go/loader )
81+ The [ ` golang.org/x/tools/go/loader ` package] ( https://pkg.go.dev /golang.org/x/tools/go/loader )
8282from the ` x/tools ` repository is a client of the type
8383checker that loads, parses, and type-checks a complete Go program from
8484source code.
@@ -133,10 +133,10 @@ the _hello, world_ program, supplied as a string.
133133Later examples will be variations on this one, and we'll often omit
134134boilerplate details such as parsing.
135135To check out and build the examples,
136- run ` go get github.com/golang /example/gotypes/... ` .
136+ run ` go get golang.org/x /example/gotypes/... ` .
137137
138138
139- // go get github.com/golang /example/gotypes/pkginfo
139+ // go get golang.org/x /example/gotypes/pkginfo
140140
141141```
142142package main
@@ -243,7 +243,7 @@ Finally, the program prints the attributes of the package, shown below.
243243
244244
245245```
246- $ go build github.com/golang /example/gotypes/pkginfo
246+ $ go build golang.org/x /example/gotypes/pkginfo
247247$ ./pkginfo
248248Package "cmd/hello"
249249Name: main
@@ -492,7 +492,7 @@ The function below prints the location of each referring and defining
492492identifier in the input program, and the object it refers to.
493493
494494
495- // go get github.com/golang /example/gotypes/defsuses
495+ // go get golang.org/x /example/gotypes/defsuses
496496
497497```
498498func PrintDefsUses(fset *token.FileSet, files ...*ast.File) error {
@@ -522,7 +522,7 @@ func PrintDefsUses(fset *token.FileSet, files ...*ast.File) error {
522522Let's use the _ hello, world_ program again as the input:
523523
524524
525- // go get github.com/golang /example/gotypes/hello
525+ // go get golang.org/x /example/gotypes/hello
526526
527527```
528528package main
@@ -539,7 +539,7 @@ This is what it prints:
539539
540540
541541```
542- $ go build github.com/golang /example/gotypes/defsuses
542+ $ go build golang.org/x /example/gotypes/defsuses
543543$ ./defsuses
544544hello.go:1:9: "main" defines <nil>
545545hello.go:5:6: "main" defines func hello.main()
@@ -783,7 +783,7 @@ Observe that the `ParseComments` flag directs the parser to
783783preserve comments in the input.
784784
785785
786- // go get github.com/golang /example/gotypes/lookup
786+ // go get golang.org/x /example/gotypes/lookup
787787
788788```
789789func main() {
@@ -853,7 +853,7 @@ Here's the output:
853853
854854
855855```
856- $ go build github.com/golang /example/gotypes/lookup
856+ $ go build golang.org/x /example/gotypes/lookup
857857$ ./lookup
858858At hello.go:6:1, "append" = builtin append
859859At hello.go:8:9, "fmt" = package fmt
@@ -1467,7 +1467,7 @@ The statement below inspects every expression within the AST of a single
14671467type-checked file and prints its type, value, and mode:
14681468
14691469
1470- // go get github.com/golang /example/gotypes/typeandvalue
1470+ // go get golang.org/x /example/gotypes/typeandvalue
14711471
14721472```
14731473// f is a parsed, type-checked *ast.File.
@@ -1517,7 +1517,7 @@ the program prints:
15171517
15181518
15191519```
1520- $ go build github.com/golang /example/gotypes/typeandvalue
1520+ $ go build golang.org/x /example/gotypes/typeandvalue
15211521$ ./typeandvalue
15221522make(map[string]int) mode: value
15231523 type: map[string]int
@@ -1573,7 +1573,7 @@ call `x.f()` was intended;
15731573comparing a method ` x.f ` against nil is a common mistake.
15741574
15751575
1576- // go get github.com/golang /example/gotypes/nilfunc
1576+ // go get golang.org/x /example/gotypes/nilfunc
15771577
15781578```
15791579// CheckNilFuncComparison reports unintended comparisons
@@ -1640,7 +1640,7 @@ the program reports these errors:
16401640
16411641
16421642```
1643- $ go build github.com/golang /example/gotypes/nilfunc
1643+ $ go build golang.org/x /example/gotypes/nilfunc
16441644$ ./nilfunc
16451645input.go:7:5: comparison of function Bytes == nil is always false
16461646input.go:7:25: comparison of function Repeat != nil is always true
@@ -1894,7 +1894,7 @@ The `main` function (not shown) loads the specified package and
18941894calls ` PrintSkeleton ` with the remaining two arguments:
18951895
18961896
1897- // go get github.com/golang /example/gotypes/skeleton
1897+ // go get golang.org/x /example/gotypes/skeleton
18981898
18991899```
19001900func PrintSkeleton(pkg *types.Package, ifacename, concname string) error {
@@ -1968,7 +1968,7 @@ The following program inspects all pairs of package-level named types
19681968in ` pkg ` , and reports the types that satisfy each interface type.
19691969
19701970
1971- // go get github.com/golang /example/gotypes/implements
1971+ // go get golang.org/x /example/gotypes/implements
19721972
19731973```
19741974// Find all named types at package level.
@@ -2000,7 +2000,7 @@ for _, T := range allNamed {
20002000Given this input,
20012001
20022002
2003- // go get github.com/golang /example/gotypes/implements
2003+ // go get golang.org/x /example/gotypes/implements
20042004
20052005```
20062006const input = `package main
@@ -2022,7 +2022,7 @@ the program prints:
20222022
20232023
20242024```
2025- $ go build github.com/golang /example/gotypes/implements
2025+ $ go build golang.org/x /example/gotypes/implements
20262026$ ./implements
20272027*hello.A satisfies hello.I
20282028hello.B satisfies hello.I
@@ -2177,7 +2177,7 @@ Such a tool could help identify inefficient parameter passing in your
21772177programs.
21782178
21792179
2180- // go get github.com/golang /example/gotypes/hugeparam
2180+ // go get golang.org/x /example/gotypes/hugeparam
21812181
21822182```
21832183var bytesFlag = flag.Int("bytes", 48, "maximum parameter size in bytes")
@@ -2336,7 +2336,7 @@ Here's the first part of the program, showing how to load an entire
23362336program starting from the single package, ` pkgpath ` :
23372337
23382338
2339- // go get github.com/golang /example/gotypes/doc
2339+ // go get golang.org/x /example/gotypes/doc
23402340
23412341```
23422342pkgpath, name := os.Args[1], os.Args[2]
@@ -2362,7 +2362,7 @@ Notice that we instructed the parser to retain comments during parsing.
23622362The rest of the program prints the output:
23632363
23642364
2365- // go get github.com/golang /example/gotypes/doc
2365+ // go get golang.org/x /example/gotypes/doc
23662366
23672367```
23682368// Print the object and its methods (incl. location of definition).
0 commit comments