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...
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!
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?
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
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.
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?
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!
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
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 }
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...
Good work man! This comment should be voted up. I've seen a lot of other comments with people having the same problem.
thx man!
thanks man)
Thanks a lot sir. This is the real tutorial 👏🏾
yeah, this is an important comment.
as a non programmer that is trying to learn how to do more than read and generally understand code, this has helped.
Thanks! Glad to hear it’s been helpful, enjoy your learning experience!
it is still showing me that cannot find package in GOROOT and GOPATH. can you help me with this?
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!
Thanks for the great guide, helped me a lot for setting up Go on my new custom built computer!
Denny Koh awesome, glad to hear! Enjoy your new build
great, thank you, just wrote my first go program :3
I HAVE seen the video 5 times still didn't get the last part in the command prompt.
You cut the video in #7:43, how did you get rid of the Error ?
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 ?
Great job Sir, it was helpful in solving GOPATH problems!
in 2019 it was no longer mandatory for you use put all your go code in the gopath
package customtext is not in GOROOT (C:\Program Files\Go\src\customtext)
The tutorial is easy to understand...thanks for the good work, I subscribe right away!!!!
Thanks for the kind words! Glad it was useful, best of luck with your programming!
Thank you so much thank you thank you sir, this is very well explained and tested
this does not work. Arent you missing the step where you add it as a path variable?
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?
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
Thank you!!
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
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.
thanks a lot, it was very useful
It is Easy and Helpful. Thanks
It helped me out thanks
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?
Same question here! It would be great if one of the experts reading this can clarify, tx
ありがとう Thanks,good job!
Thank you for the help! It was very useful
nice job
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?
Thanks ,good job!!!
Thanks Bro! ✨👍
Why is there no path folder after installation: C:\Users\%username%\go ? no such folder
Amazing X 1000
Doesn't work for me... I can't use methods from my custom packages... :(
Really nice video brother but i am facing an issue ....i am not able to import local packages...please help
Good tutorial. Just one question: Why don't you use Terminal inside Visual Studio for running program?
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!
You can see go tutorial here
ua-cam.com/video/jWf1xD5yhbg/v-deo.html
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
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
}
Good point! It’s nice to have the ability of adding some custom rules like this one in your settings.json.
good job
thanks bro worked
tyvm, man
thank very much
why set up different folder?
thanks for your video
Thanks for your comment, appreciate it!
So if i want to create a new project in another location, i need to change the gopath again?
yes
thanks man
i cant find where my GOROOT is. help me boys
if it's default it must be in C:\Program Files
why does go do this so weirdly?
thank u
Compiling really is slow
Thanks, good job!