GO Hello World program
A simple GO program to display "Hello, World!" on the screen. Traditionally, the first program you write in any programming language is called a "Hello, World" program—a program that simply outputs Hello, World to your terminal.
Example
package main // Package Declaration, every Go program must start with it
// White Spaces or Newline or Tabs, Go mostly doesn't care about this
import "fmt" // import is a keyword use to include code fro other package
// fmt is package
// use of double quotes like this is known as String literal
/* ======Function Declration Starts==== */
func main(){ // all functions start with keyword func followed by name of function
fmt.Println("Hello World") //function inside fmt package called Println
}
/* ======Function Declration Ends====== */
The line starts with // is known as a comment. Comments are ignored by GO compiler.
You can use /* */ to write multiple line comments.
The main piece of our program line is:
fmt.Println("Hello World")
Println function called Under fmt package,
Most Helpful This Week
GO Program to take user input and addition of two strings
How to Convert string to float type in Go?
GO Program to Check Armstrong Number
GO Program to Generate Fibonacci Sequence Up to a Certain Number
Defining a type that satisfies an interface in Go Programming Language
What is state in React?
Golang program for implementation of Random Maze Generator
Sierpinski Carpet in Go Programming Language
Golang Concurrency Best Practices
Unveiling the Potential of Quantum Computing in AI: A Game Changer for Industries