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.

go mod init hello

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

// You can edit this code!
// Click here and start typing.
package main
import "fmt"
func main() {
var companies = [4]string{"Amazon", "Microsoft", "Yahoo", "Google"}
fmt.Println("Array of Strings is: ", companies)
var intArrays [5]int
intArrays[0] = 78
intArrays[1] = 85
intArrays[2] = 91
intArrays[3] = 93
intArrays[4] = 97
fmt.Println("Array of Integers is: ", intArrays)
fmt.Println("Size of IntegersArray is: ", len(intArrays))
fmt.Println("Size of StringArray is: ", len(companies))

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 :-

go run <NAME_OF_FILE.go>

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

go run .

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

go build .
  • 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

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Mac Microsoft Teams Update

Root-Me Writeup — Remote File Inclusion

AWS Identity and Access Management (IAM) provides fine-grained access control across all of AWS.

I love Swift, I hate to use Swift

OAuth2 Google Sign-In in Spring Boot 2.x.x

Adventures in GameDev with GameDevHQ! Day 28: Creating enemy explosions!

Reduce all the things

Interface Segregation

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
aditya goel

aditya goel

Software Engineer for Big Data distributed systems

More from Medium

Beginners guide to Go-Lang | Part1

Delve With VSCode To Debug Go App

GoReleaser v1.6 — the boring release

Learn how to containerize your Go app in 5 minutes!