GOPATH Setup Windows 2021 | Golang Tutorial

Поділитися
Вставка
  • Опубліковано 6 вер 2024

КОМЕНТАРІ • 74

  • @lovesouthkorea6505
    @lovesouthkorea6505 3 роки тому +40

    While running this test.go file (test.go:5:1: package customtext is not in GOROOT (c:\go\src\customtext)) this error came. I set the environment variable for Path too but the system only look the goroot path for the package?
    But after executing this command "go env -w GO111MODULE=off" the import will look into the workspace src directory and it is working fine...

    • @davidcorona644
      @davidcorona644 3 роки тому +4

      Good work man! This comment should be voted up. I've seen a lot of other comments with people having the same problem.

    • @sab13L
      @sab13L 3 роки тому +1

      thx man!

    • @galammadin
      @galammadin 2 роки тому

      thanks man)

    • @feliciaabolupe9668
      @feliciaabolupe9668 2 роки тому +1

      Thanks a lot sir. This is the real tutorial 👏🏾

    • @kirzap
      @kirzap 2 роки тому

      yeah, this is an important comment.

  • @a7djen8408
    @a7djen8408 4 роки тому +1

    as a non programmer that is trying to learn how to do more than read and generally understand code, this has helped.

    • @JonathanRintala
      @JonathanRintala  4 роки тому

      Thanks! Glad to hear it’s been helpful, enjoy your learning experience!

  • @TheWandererAbhi
    @TheWandererAbhi 4 роки тому +13

    it is still showing me that cannot find package in GOROOT and GOPATH. can you help me with this?

  • @cameronmitchell107
    @cameronmitchell107 3 роки тому +3

    You are an absolute legend for uploading this, thanks so much for the help! Another way to get your go script to run is by using the built-in terminal in VS code. Not sure if this was available during the upload time of this video, but thought you may find it interesting. Thank you once again for the help!

  • @dennykoh6613
    @dennykoh6613 4 роки тому +3

    Thanks for the great guide, helped me a lot for setting up Go on my new custom built computer!

    • @JonathanRintala
      @JonathanRintala  4 роки тому

      Denny Koh awesome, glad to hear! Enjoy your new build

  • @daryazat8049
    @daryazat8049 3 роки тому +3

    great, thank you, just wrote my first go program :3

  • @visheshsharma6723
    @visheshsharma6723 3 роки тому +2

    I HAVE seen the video 5 times still didn't get the last part in the command prompt.

  • @oussamasethoum2755
    @oussamasethoum2755 3 роки тому +2

    You cut the video in #7:43, how did you get rid of the Error ?

  • @chandraratiwi3309
    @chandraratiwi3309 3 роки тому +2

    For a while, my GOPATH is already set, but when I try to import it still refers to GOROOT, so I have to make a file in GOROOT also. How to fix ?

  • @911419834
    @911419834 2 роки тому +1

    Great job Sir, it was helpful in solving GOPATH problems!

    • @redditstories2836
      @redditstories2836 2 роки тому

      in 2019 it was no longer mandatory for you use put all your go code in the gopath

  • @abdullahsaid8561
    @abdullahsaid8561 3 роки тому +1

    package customtext is not in GOROOT (C:\Program Files\Go\src\customtext)

  • @maosamoelaabraham5012
    @maosamoelaabraham5012 4 роки тому +4

    The tutorial is easy to understand...thanks for the good work, I subscribe right away!!!!

    • @JonathanRintala
      @JonathanRintala  4 роки тому +1

      Thanks for the kind words! Glad it was useful, best of luck with your programming!

  • @stevekamga5977
    @stevekamga5977 3 роки тому +1

    Thank you so much thank you thank you sir, this is very well explained and tested

  • @bubblesgrappling736
    @bubblesgrappling736 3 роки тому +1

    this does not work. Arent you missing the step where you add it as a path variable?

  • @TheBIMCoordinator
    @TheBIMCoordinator 3 роки тому +2

    Great video! I keep getting this error "gopls requires a module at the root of your workspace.". I have tried to find resources with little luck. Any idea why I am getting this?

  • @SaurabhGupta-xv4fk
    @SaurabhGupta-xv4fk 4 роки тому +2

    there is no need to set user path to Desktop
    instead set it to where golang is installed and to the bin folder
    C:\Go\bin

  • @crinkied
    @crinkied 8 місяців тому +1

    Thank you!!

  • @gerolori
    @gerolori 3 роки тому +2

    For some reason I couldn't get the gopath in go env to update with the new variable I've changed as you said, even after restarting cmd, I needed to fully restart the computer to properly show the right gopath in cmd, I shared this cause it might help someone

    • @nicholaspreston9586
      @nicholaspreston9586 2 роки тому

      Because Windows has a real problem with updating the $PATH variable in general. Always has. Expect to restart after at least 1/10th of your installs that involve modifying that value manually or (rare) automatically. I usually run all my installs, then restart, especially with older exes.

  • @Coccoutube
    @Coccoutube 2 роки тому +1

    thanks a lot, it was very useful

  • @omarbarra3456
    @omarbarra3456 4 роки тому +1

    It is Easy and Helpful. Thanks

  • @deothguei2354
    @deothguei2354 3 роки тому +1

    It helped me out thanks

  • @Abhi-qi6wm
    @Abhi-qi6wm 2 роки тому +1

    A noobie question. Why didn't you name the file (test.go) to main.go instead? Also, shouldn't the folder it's in be main instead of test?

    • @bharat-anand
      @bharat-anand Рік тому

      Same question here! It would be great if one of the experts reading this can clarify, tx

  • @stkomatsustkomatsu5183
    @stkomatsustkomatsu5183 3 роки тому +1

    ありがとう Thanks,good job!

  • @ammanmalik4248
    @ammanmalik4248 4 роки тому +1

    Thank you for the help! It was very useful

  • @system4203
    @system4203 4 місяці тому

    nice job

  • @spofhej3323
    @spofhej3323 3 роки тому

    I followed exactly what you said hello, but it looked in the root folder again to find the customtext, it gave an error when it couldn't find it there, I think the feature you said in the last version (the event of going to gopath if you can't find it in goroot) has been removed?

  • @user-mx4uf9lq2g
    @user-mx4uf9lq2g 3 роки тому +1

    Thanks ,good job!!!

  • @stephendelacruzone
    @stephendelacruzone 2 роки тому

    Thanks Bro! ✨👍

  • @tekiero
    @tekiero 4 роки тому

    Why is there no path folder after installation: C:\Users\%username%\go ? no such folder

  • @staulik
    @staulik 4 роки тому +1

    Amazing X 1000

  • @theweebchannel4850
    @theweebchannel4850 3 роки тому

    Doesn't work for me... I can't use methods from my custom packages... :(

  • @salmaan6094
    @salmaan6094 4 роки тому

    Really nice video brother but i am facing an issue ....i am not able to import local packages...please help

  • @ChrisVitez
    @ChrisVitez 4 роки тому +1

    Good tutorial. Just one question: Why don't you use Terminal inside Visual Studio for running program?

    • @JonathanRintala
      @JonathanRintala  4 роки тому +1

      Thanks! I wanted to make it clear and concise, and therefore use the regular terminal. I’m usually on Mac which has a nice native terminal, but on Windows I prefer the VsCode terminal as you mention. Enjoy your coding!

    • @vivekdubey2607
      @vivekdubey2607 4 роки тому

      You can see go tutorial here
      ua-cam.com/video/jWf1xD5yhbg/v-deo.html

  • @Trading_sikho
    @Trading_sikho 4 роки тому

    Heyy bro ....great video but can you please make a video on how to set up go file in visual studio 2019 because its first time i m using the visual studio as well as golang

  • @stuffinfinland
    @stuffinfinland 4 роки тому +1

    github.com/Microsoft/vscode-go/issues/1930 annoying bug if you're using Visual Studio Code. Upon saving, it adds tabs to the code. CTRL + shift + P -> settings.json ->
    "[go]": {
    "editor.formatOnSave": false
    }

    • @JonathanRintala
      @JonathanRintala  4 роки тому

      Good point! It’s nice to have the ability of adding some custom rules like this one in your settings.json.

  • @FootballLab
    @FootballLab 4 роки тому +1

    good job

  • @lalit7562
    @lalit7562 2 місяці тому

    thanks bro worked

  • @Zxoro
    @Zxoro 2 роки тому

    tyvm, man

  • @knowingthetruth4867
    @knowingthetruth4867 4 роки тому +1

    thank very much

  • @tekiero
    @tekiero 4 роки тому

    why set up different folder?

  • @bkmusic410
    @bkmusic410 5 років тому +1

    thanks for your video

  • @jpbm6369
    @jpbm6369 4 роки тому

    So if i want to create a new project in another location, i need to change the gopath again?

  • @bobyrasta100
    @bobyrasta100 4 роки тому +1

    thanks man

  • @scypto9458
    @scypto9458 3 роки тому

    i cant find where my GOROOT is. help me boys

    • @gerolori
      @gerolori 3 роки тому

      if it's default it must be in C:\Program Files

  • @sergsergesrgergseg
    @sergsergesrgergseg 2 роки тому

    why does go do this so weirdly?

  • @storyh66224
    @storyh66224 4 роки тому

    thank u

  • @gastroacid1971
    @gastroacid1971 4 роки тому

    Compiling really is slow

  • @baurzhanalzhanov4741
    @baurzhanalzhanov4741 4 роки тому +1

    Thanks, good job!