I downloaded Go for Windows (go.weekly.2012-01-27.windows-amd64.tar.gz), set the environment variables
GOOS=windows
GOROOT=c:\go
GOBIN=c:\go\bin
GOARCH=386
and was able to create a HelloWorld.exe. Now I've tried a very simple example that imports "http", but it doesn't find it. Do I need goinstall or add sth. to the PATH?
goimports If your project does not have goimports, click the go get goimports link in the Goimports file notification window. Otherwise, open the Terminal tool window (View | Tool Windows | Terminal), and type the following command to install goimports: go get golang.org/x/tools/cmd/goimports . Press Enter .
Create a file basic.go inside the basic folder. The file inside the basic folder should start with the line package basic as it belongs to the basic package. Create a file gross.go inside the gross folder. The file inside the gross folder should start with the line package gross as it belongs to the gross package.
Golang Import Local PackagesIn the root of your project, aka, the workspace directory, create a main.go file. In the example above, we add 3 import clauses to import all the packages in our program. Once imported, we can use the exported code in the packages.
import "net/http" // was "http" in r60 IIRC
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With