Skip to content

Commit a664ba5

Browse files
committed
go
1 parent bc6bf1b commit a664ba5

File tree

1 file changed

+44
-2
lines changed

1 file changed

+44
-2
lines changed

pages/go/index.html

Lines changed: 44 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,53 @@
1313
<div class="body">
1414
<div class="inside">
1515
<h2>xxxxxxxx</h2>
16-
<a href=""></a>
1716
<script type="editor" data-lang="golang">
1817
package main
1918

20-
func main() {}
19+
import "fmt"
20+
21+
func main() {
22+
fmt.Println("Hello, World!")
23+
}
24+
</script>
25+
<h2>CLI</h2>
26+
<script type="editor" data-lang="sh">
27+
28+
// more: https://github.com/stopsopa/go-lang-research
29+
30+
go mod init https://go.dev/doc/tutorial/getting-started
31+
go mod init example/hello
32+
go mod tidy https://go.dev/doc/tutorial/getting-started
33+
# that will look through the code and find all
34+
import (
35+
"fmt"
36+
37+
"rsc.io/quote"
38+
)
39+
and will create block like
40+
require rsc.io/quote v1.5.2
41+
in go.mod file
42+
43+
go run . https://go.dev/doc/tutorial/getting-started
44+
go build https://go.dev/doc/tutorial/compile-install
45+
46+
go list -f '{{.Target}}' https://go.dev/doc/tutorial/compile-install
47+
https://pkg.go.dev/cmd/go#hdr-List_packages_or_modules
48+
# some experiments with that:
49+
go env GOPATH | tr -d '\n' to get path to go binaries installed globally
50+
51+
export PATH="${PATH}:$(go env GOPATH | tr -d '\n')/bin"
52+
add this to your ~/.bashrc or ~/.zshrc to mount installation
53+
you can override the path using:
54+
go env -w GOBIN=/path/to/your/bin https://go.dev/doc/tutorial/compile-install
55+
56+
57+
58+
59+
60+
package manager https://pkg.go.dev/search?q=quote
61+
62+
2163
</script>
2264
</div>
2365
</div>

0 commit comments

Comments
 (0)