File tree 1 file changed +44
-2
lines changed
1 file changed +44
-2
lines changed Original file line number Diff line number Diff line change 13
13
< div class ="body ">
14
14
< div class ="inside ">
15
15
< h2 > xxxxxxxx</ h2 >
16
- < a href =""> </ a >
17
16
< script type ="editor " data-lang ="golang ">
18
17
package main
19
18
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 ~ / .b a s h r c o r ~ / . zshrc to mount installation
53
+ you can override the path using :
54
+ go env - w GOBIN = / p a t h / 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
+
21
63
</ script >
22
64
</ div >
23
65
</ div >
You can’t perform that action at this time.
0 commit comments