-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcommands.bash
More file actions
39 lines (29 loc) · 893 Bytes
/
commands.bash
File metadata and controls
39 lines (29 loc) · 893 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# List of commands
go get gopkg.in/yaml.v3
# ------------------
# Workspace
# ------------------
# https://go.dev/doc/tutorial/workspaces
go work init ./hello
# Add module to workspace
go work use ./example/hello
# syncs dependencies from the workspace’s build list into each of the workspace modules.
go work sync
go work use ./workspace/io/filedb
go work use ./workspace/dir1/dir2/dir3/mymodule
# https://go.dev/ref/mod#environment-variables
GOWORK=off go run main.go
# ------------------
# Modules
# ------------------
go mod init github.com/koubae/go-example
mkdir hello; cd hello;
go mod init github.com/koubae/go-example/hello
mkdir cmd pkg internal examples scripts
cd examples
mkdir http; cd http;
mkdir server-1 server-2
cd server-1
go mod init github.com/koubae/go-example/examples/http/server-1
cd server-2
go mod init github.com/koubae/go-example/examples/http/server-2