Scale up as you grow — whether you're running one virtual machine or ten thousand.

From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.

This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
“If you plan to use Git to commit and store your Go code on GitHub, you can replace the value user with your GitHub username. This is recommended because this will allow you to import external Go packages. However, if you do not plan to use GitHub to store and manage your code, you can use any folder structure, like ~/my_project.”
How does this effect things? I am relatively new to linux/git. Right now generally I just clone a repository into a workspace, and then use that directory as the project file.
Thanks
Hi i have followed the exactly same command you had mentioned but my code is not working i am getting this error rajdeeep@rajdeep ~ $ sudo nano ~/.profile [sudo] password for rajdeeep: rajdeeep@rajdeep ~ $ cd work rajdeeep@rajdeep ~/work $ go install github.com/clock21am/hello can’t load package: package github.com/clock21am/hello: cannot find package “github.com/clock21am/hello” in any of: /usr/src/pkg/github.com/clock21am/hello (from $GOROOT) /Go/src/github.com/clock21am/hello (from $GOPATH)
nano /home/work/src/github.com/user/hello.go
Above line should be:
nano /home/work/src/github.com/user/hello/hello.go
Otherwise if when you run “go install github.com/user/hello” it will error:
can't load package: package github.com/user/hello: no buildable Go source files in ...
This comment has been deleted
There were a couple issues I had with this guide:
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games
If this is a fresh install of Ubuntu for go development like mine, then ~/.nano_history will be owned by root and give errors each time it’s subsequently run without sudo. sudo chown username ~/.nano_history resolves that issue
Nowhere in the guide is there a CD command or does it tell you which directory to execute from. This could be very confusing for newer people. I lost context towards the bottom when I was moving around on my own. The only indication of where to be is that the first step is to SSH in and there are no CD commands later so you should be in the home directory I’m assuming. But again, assuming. There are no CD commands or working directory confirmation notices in the guide.
Right now I’m stuck because:
$ go install github.com/user/hello
cannot find package "fmt" in any of:
(from $GOROOT)
(from $GOPATH)
package github.com/user/hello
imports runtime: cannot find package "runtime" in any of:
(from $GOROOT)
(from $GOPATH)
For anyone else reading this and wondering why it’s not working on Ubuntu. You need to unset GOROOT, to fix the “cannot import absolute path” error and you need to make a ‘bin’ folder inside your $GOPATH which is /home/user/work in this tutorial. Just ‘mkdir bin’ and you’ll fix the error “no install location (GOBIN not set)”
Third and hopefully final update but no guarantee. New Ubuntu users should note that the file ~/.profile is not loaded automatically by Ubuntu. The file that you should be editing with your path changes is ~/.bash_profile otherwise next time you start up Ubuntu you’ll have go issues again.
I would suggest using real deb packages for Go:
$ sudo apt-add-repository ppa:ubuntu-lxc/lxd-stable
$ sudo apt-get update
$ sudo apt-get install golang
This will install Go 1.6 as of today.