Skip to content

Commit 8dad866

Browse files
committed
sort out some module mistakes (new to go!)
1 parent c8c4602 commit 8dad866

File tree

5 files changed

+12
-11
lines changed

5 files changed

+12
-11
lines changed

cli-files/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ Create `go.mod`, `main.go`, `cmd/root.go`. The `touch` command creates files: `t
7575

7676
```go
7777
// go.mod
78-
module vinery/cli-files/go-ls
78+
module go-ls
7979

8080
go 1.18
8181
```
@@ -85,7 +85,7 @@ go 1.18
8585
package main
8686

8787
import (
88-
"vinery/cli-files/go-ls/cmd"
88+
"go-ls/cmd"
8989
)
9090

9191
func main() {
@@ -108,9 +108,9 @@ The Cobra [user guide](https://github.com/spf13/cobra/blob/master/user_guide.md)
108108

109109
To use your command, install and run it: `go install .`
110110

111-
Then run the following so that your command line knows where to look for the executable code that Go is generating: `export PATH=$PATH:$(dirname $(go list -f '{{.Target}}' .))`
111+
To run the code, you need to tell your command line where executable code compiled from go lives. The way to do this is different depending on your operating system, but here's [a guide on the Go website](https://go.dev/doc/install) — look at anything that mentions `go/bin` on your `PATH`.
112112

113-
You should now be able to run `go-ls`.
113+
Once added, you should now be able to run `go-ls`.
114114

115115
Now, when you change your code, install and run it: `go install . && go-ls`
116116

cli-files/go-cat/go.mod

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@ module go-cat
22

33
go 1.18
44

5+
require github.com/spf13/cobra v1.5.0
6+
57
require (
68
github.com/inconshreveable/mousetrap v1.0.0 // indirect
7-
github.com/spf13/cobra v1.5.0 // indirect
89
github.com/spf13/pflag v1.0.5 // indirect
910
)

cli-files/go-ls/go.mod

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
module vinery/cli-files/go-ls
1+
module go-ls
22

33
go 1.18
44

5-
require github.com/spf13/cobra v1.4.0
5+
require github.com/spf13/cobra v1.5.0
66

77
require (
88
github.com/inconshreveable/mousetrap v1.0.0 // indirect

cli-files/go-ls/go.sum

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
github.com/cpuguy83/go-md2man/v2 v2.0.1/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
1+
github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
22
github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM=
33
github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8=
44
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
5-
github.com/spf13/cobra v1.4.0 h1:y+wJpx64xcgO1V+RcnwW0LEHxTKRi2ZDPSBjWnrg88Q=
6-
github.com/spf13/cobra v1.4.0/go.mod h1:Wo4iy3BUC+X2Fybo0PDqwJIv3dNRiZLHQymsfxlB84g=
5+
github.com/spf13/cobra v1.5.0 h1:X+jTBEBqF0bHN+9cSMgmfuvv2VHJ9ezmFNf9Y/XstYU=
6+
github.com/spf13/cobra v1.5.0/go.mod h1:dWXEIy2H428czQCjInthrTRUg7yKbok+2Qi/yBIJoUM=
77
github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
88
github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
99
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=

cli-files/go-ls/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package main
22

33
import (
4-
"vinery/cli-files/go-ls/cmd"
4+
"go-ls/cmd"
55
)
66

77
func main() {

0 commit comments

Comments
 (0)