Skip to content

Commit bd50df0

Browse files
committed
satisfy my OCD
1 parent 1a030c1 commit bd50df0

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

go/modules.md

+4-2
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ You have a local package `sample.com/math` that does not exist in a remote repo
5252
that you would like to import into your `school` project. How can we accomplish
5353
this?
5454

55+
#### Solution
5556
First you must initialize the modules of each project:
5657
```
5758
# in the math dir
@@ -76,7 +77,8 @@ The projects should both contain `go.mod` files:
7677
```
7778

7879
Next, we need to manually update the `school` project's `go.mod` file using the
79-
[replace directive](https://golang.org/ref/mod#go-mod-file-replace)
80+
[replace directive](https://golang.org/ref/mod#go-mod-file-replace) and a
81+
relative path:
8082
```
8183
module school
8284
@@ -99,7 +101,7 @@ The final step is to run [go mod tidy](https://golang.org/ref/mod#go-mod-tidy) w
99101
go: found sample.com/math in sample.com/math v0.0.0-00010101000000-000000000000
100102
```
101103

102-
Finally, we can successfully import the local package:
104+
Finally, we can successfully import the local package and run:
103105
```
104106
~/code/go/module-test/school $ go run main.go
105107
6

0 commit comments

Comments
 (0)