I have Go installed and in my system PATH

I am able to access Go in my terminal. How to use Go now ? Do I need to just use the terminal, or do I need an editor / IDE, Conda / PiP environments ?

Now you can use an editor or ide like VisualStudio Code, Atom, etc.
There also commercial options…

Do I point VSC / Atom … at my Go installation ?

Just put your Go installation directory in your PATH var.
Also download a Go plugin for your selected IDE/editor

1 Like
  1. Make sure that you add your drive:\go\bin folder to the computers system path. Mine is “d:\go”
  2. Create a folder for all of your go projects. I use “go_projects”, “d:\go_projects” to be exact.
  3. Add a environment variable for GOROOT="d:\go"
  4. Add a environment variable for GOPATH="d:\go_projects"

close all terminals/shells, best just reboot.
Now open up VSC and you should be fine. I would also have your “GitHub?” ready to go. Your projects or repositories will be located at “d:\go_projects\src\github.com{GithubUserName{RepositoryName}” and you or someoenelse will import that package via import "github.com\{GithubUserName\{RepositoryName}"

Do I need the absolute or relative path to the file or the go install ? do I also have to change the file name each time I run a different file ?

No, that is your launch json config file. unless you need advanced features, like your app needs command line arguments (or you want to send in some command line arguments) you should not need to adjust that file. Also take a look at https://github.com/golang-standards/project-layout for an excellent example of how your project should be structured. If your just learning, then I strongly suggest you tart using this on ever new project. Just delete the folders/files you wont need and start coding. I would also start with https://gobyexample.com/ and work my way through all examples. This will not only help you learn Go but how to create and build files.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.