-
Notifications
You must be signed in to change notification settings - Fork 0
/
Go
53 lines (30 loc) · 727 Bytes
/
Go
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
####Code examples and libraries for Golang will live here####
##Tools
##https://golang.org/src/crypto/tls/generate_cert.go
##Hello World################
package main
import "fmt"
func main() {
fmt.Printf("Hello, Go World!!\n")
}
#####Once go is installed
go version
go env
go env GOPATH ##the default is $HOME/go
mkdir $HOME/go
mkdir -p $HOME/go/src/hello
cd ~/go/src/hello
touch hello.go
##Use the above code for your first go app and then
go run hello.go ##run interpreted
##Then
go build .
#or
go build
##this should build a binary called hello
./hello
## initialize module
go mod init
## as long as you are not being blocked from this on a corporate network
go get -u -v
go build myfile.go