How to write Golang basic program ?
Here's an example of a basic "Hello, World!" program in Golang:
package main
import "fmt"
func main() {
fmt.Println("Hello, World!")
}
In this program, we first import the fmt package, which provides functions for formatting and printing output. We then define a main() function, which is the entry point for our program. Finally, we use the fmt.Println() function to print the string "Hello, World!" to the console. When we run this program, it will output "Hello, World!" to the console.
Comments
Post a Comment