See https://getstream.io/blog/switched-python-go/
choco install -y golang
Then restart the terminal and test the installation:
go version
Display env variables:
go env
It is located at $env:GOPATH
: C:\Users\Nicolas\go
Best practice is:
└── $HOME
└── go
├── bin
└── src
When Go compiles and installs tools, it will put them in the $GOPATH/bin directory.
go run 01_hello.go
Built-in linter:
gofmt -w 01_hello.go
Convert Go to C code (C shared library):
go build -buildmode=c-shared -o 01_hello.so 01_hello.go
This creates 2 files, 01_hello.h and 01_hello.so. The 01_hello.so file is the compiled binary and 01_hello.h is the header to describe what methods and types are defined within the binary. Then the shared library can be imported in C or Python...