I have Go installed and in my system PATH


(Paul A. Gureghian) #1

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 ?


(Yamil Bracho) #2

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


(Paul A. Gureghian) #3

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


(Yamil Bracho) #4

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


(Andrew Donelson) #5
  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}"


(Paul A. Gureghian) #6

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 ?


(Eric Lindblad) #7

"github.com/user/stringutil"

the ImportPaths example (using bash) might be more clear


(Andrew Donelson) #8

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.


(Eric Lindblad) #9

some comments referring to json files for VCS / Atom

this current opened topic (above) has this line

"github.com\{GithubUserName\{RepositoryName}"

whereas that syntax appears different than in this comment pertaining to debug window settings


(system) closed #10

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