diff --git a/_content/doc/tutorial/call-module-code.html b/_content/doc/tutorial/call-module-code.html index 1a63d8cecd..97a5b15fa5 100644 --- a/_content/doc/tutorial/call-module-code.html +++ b/_content/doc/tutorial/call-module-code.html @@ -24,7 +24,7 @@ After you create this directory, you should have both a hello and a greetings directory at the same level in the hierarchy, like so:
-<home>/ ++<home>/ |-- greetings/ |-- hello/@@ -37,8 +37,7 @@ cd .. mkdir hello cd hello -
To enable dependency tracking for your code, run the
- go mod init
command, giving it the name of the module
- your code will be in.
go mod init
command, giving it the name of the module
+ your code will be in.
+
- For the purposes of this tutorial, use example.com/hello
- for the module path.
+ For the purposes of this tutorial, use example.com/hello
+ for the module path.
@@ -142,31 +140,31 @@ From the command prompt in the hello directory, run the following command: --$ go mod edit -replace=example.com/greetings=../greetings -++ $ go mod edit -replace example.com/greetings=../greetings +-- The command specifies that
+example.com/greetings
should be - replaced with../greetings
for the purpose of locating the - dependency. After you run the command, the go.mod file in the hello - directory should include a -replace
directive: -+ The command specifies that
example.com/greetings
should be + replaced with../greetings
for the purpose of locating the + dependency. After you run the command, the go.mod file in the hello + directory should include a +replace
directive: +-module example.com/hello + module example.com/hello -go 1.16 + go 1.16 -replace example.com/greetings => ../greetings -+ replace example.com/greetings => ../greetings +
go mod tidy
command to synchronize the
+ go mod tidy
command to synchronize the
example.com/hello
module's dependencies, adding those
required by the code, but not yet tracked in the module.
@@ -174,8 +172,8 @@
go: found example.com/greetings in example.com/greetings v0.0.0-00010101000000-000000000000
- After the command completes, the example.com/hello
- module's go.mod file should look like this:
+ After the command completes, the example.com/hello
+ module's go.mod file should look like this:
module example.com/hello @@ -189,7 +187,7 @@The command found the local code in the greetings directory, then added a
require
- directive to specify thatexample.com/hello
+ directive to specify thatexample.com/hello
requiresexample.com/greetings
. You created this dependency when you imported thegreetings
package in hello.go. @@ -208,7 +206,8 @@require example.com/greetings v1.1.0For more on version numbers, see - Module version numbering.
+ Module version numbering. +