Skip to content

Commit 8401eac

Browse files
committed
hello world program
1 parent 85120e6 commit 8401eac

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

Fundamentels/first.go

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
package main
2+
3+
// Every program must start with the package declaration. In Go language, packages are used to organize and reuse the code.
4+
// In Go, there are two types of program available one is executable and another one is the library.
5+
// The executable programs are those programs that we can run directly from the terminal and Libraries are the package of programs that we can reuse them in our program.
6+
// Here, the package main tells the compiler that the package must compile in the executable program rather than a shared library.
7+
// It is the starting point of the program and also contains the main function in it.
8+
9+
import(
10+
"fmt"
11+
)
12+
13+
// Here, import keyword is used to import packages in your program and fmt package is used to implement formatted Input/Output with functions.
14+
15+
func main() {
16+
fmt.Println("!... Hello World ...!")
17+
}
18+
19+
// In the above lines of code we have:
20+
// func: It is used to create a function in Go language.
21+
// main: It is the main function in Go language, which doesn’t contain the parameter, doesn’t return anything, and call when you execute your program.
22+
// Println(): This method is present in fmt package and it is used to display “!… Hello World …!” string. Here, Println means Print line.

0 commit comments

Comments
 (0)