Code:
1 2 3 4 5 6 7 | package main import "fmt" func main() { fmt.Println("Hello World!") } |
- Every go file must start with 'package name'
- 'main()' function should always exist in main package
- import "fmt" is used to import required packages
- 'fmt.Println("Hello World!")' here we are calling the Println function in fmt package so to call a function in Go we use the syntax package.function()
Happy Coding 🤖
Comments
Post a Comment