Go installation troubles

I tried to install go but it appears that the installation didn’t work, although I’m not sure exactly what’s going on with my command line either. I tried to verify the installation with the command go version, but it said command not found. Also, my command line doesn’t look like the one on the instructional video. Instead of the directory and > (Ex: Downloads>) it has Stephanie@Stephanie-PC on one line with the directory (~/downloads) and just a $ on the line to enter commands. Did I do something wrong?

what operating system do you use?

sorry. Windows 7

check if you have c:\go\bin in your PATH environment variable. also see here for complete installaton instructions.

Is this what you mean by PATH environment variable?

This is what my git shell looks like when I try to verify the installation (the way it says in the class I’m taking)

i don’t know what do you try to do with git shell… things are quite simple

  • first you must download go from here in zip format according with your architecture

  • unzip in C: and will result C:\go folder.

  • in Advanced system setting->Environment variables->User variables add to your PATH variable C:\go\bin and also make a new variable GOPATH C:\go-programs (i supose that go-programs is your current work dir). onward, make go-programs/src/ folder. in this location you must put your programs in separate folders. src is needed if you will use git later.

  • create go-programs/src/ HelloWorld folder and write a simple main.go program

      package main
    
      func main() {
        println("HelloWorld!")
      } 
    
  • in command prompt run this

      cd \go-programs\src\HelloWorld
      go build
    

if all things are well done you must can execute HelloWorld.exe from C:\go-programs\src\HelloWorld folder.

that’s all folks :relaxed:

If I’m not doing all of this in git shell, what am I using to enter the command line code and write the program? I think I managed to write the helloworld program, but i don’t know how to execute it.

follow the above steps to compile the program. also consider LiteIDE or VSCode for easy to develop programs.

Use normal console to run go commands. In windows, this is “Command Prompt”. To launch it easily:
press: WinKey + R
and type: cmd

To check what your path is, just type in your console: echo %PATH%
Your path have lot of things other than C:\go\bin ; I see only C:\go\bin in your screenshot… I’m not a Windows user, but I really hope your path is not only that.

Don’t hesitate to read posts about windows 7, how tweak it, how it works and more generally how a computer work internally. More you will be comfortable with your computer, more you will be efficient to learn new things with it. And never give up

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