Installing & Verifying GO in VS at MAC

Step #1.) First download the GO-package :-

Step #2.) Proceed to install the GO-package, by double clicking on the same :-

Step #3.) Verify now, whether the GO has been installed or not ?

Step #4.) Verify the path, where GO has been installed ?

Step #5.) Verify the PATh variable, which would indicate where GO has been installed.

Step #6.) Now, head to VS-Studio Code and install the plugin of GO in VS :-

Step #7.) Now, In VSCode, goto View → Command Palette → Locate Configured GO Tools. With this, we can see output of GO related variables :-

Step #8.) Now, head to our working directory and create a file called as “go.mod” by this command and observe that, we have a new file being created under this directory.

Step #9.) Let’s create a “main.go” file and write some sample code of GOLANG :-

Step #10.) Let’s now try running this sample go file by clicking on :- Run → Run Without Debugging.

Step #11.) Let’s observe the output of the same :-

Step #12.) Another way of executing the GO Programs is, using Integrated Terminal by using command :-

Step #13.) We can also execute the GO files directly using below command too:-

Step #13.) We can also generate the Build along with RunTime from a given source file of GO :-

  • Upon performing the build operation, note that compiled binary file specifically designed for MAC operating-system, has been generated with name “hello”.
  • We can execute this executable binary directly ONLY at this particular OS i.e. MAC and it shall NOT work on Windows.

That’s all in this section. If you liked reading this blog, kindly do press on clap button multiple times, to indicate your appreciation. We would see you in next series.

References :-

--

--

Software Engineer for Big Data distributed systems

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store