How to use GO online compiler
Overview
Go online compiler is a web-based platform where we can quickly run Go code.
Website link
GO: This is the official Go online compiler.
Compiler description
When we visit the web link above, we’ll see some intuitive features such as:
Select: To choose the environment we want to test in.
Run: This is used for executing written code.
Format: This enables editing of the code, especially after we have executed a code.
Share: This button helps us share our code on social media platforms because each code we write on the Go Online is saved and can be referenced later.
Next to the share button is a select option comprised of premade code samples to help us get started. The text field is where we type in our codes. Just beneath the text field, is where the output to our code is displayed.
Typical example of an online compiler
package mainimport "fmt"//display textfunc main() {fmt.Println("Hello,Reader" )}
Explanation
The code above is a typical GO online compiler, however, it doesn’t allow us to access all the features listed above.
- Line 3: We first import the
fmtpackage to display our output. - Line 6: We use
fmtto display the text"Hello Reader".