Simple Project Setup in Go - 01
Anurag Affection
Posted on May 16, 2024
- First check the Go version by running the command
go version
- Create a folder
mkdir <folder_name>
- Switch to created folder
cd <folder_name>
- Initialize the go project by running the given command. You will get
go.mod
file.
go mod init <folder_name>
- Create a
main.go
file
notepad main.go
touch main.go
- Let's write some basic code in
main.go
file.
package main
import (
"fmt"
)
func main () {
fmt.Println("Hello From Go")
}
- Run the code by following command
go run main.go
- You will see this output in console
Hello From Go
That's for today. Thank You .
💖 💪 🙅 🚩
Anurag Affection
Posted on May 16, 2024
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.
Related
webdev Understanding HTTP, Cookies, Email Protocols, and DNS: A Guide to Key Internet Technologies
November 30, 2024
undefined How to Run Two MongoDB Instances on the Same Server (Standalone and Replica Set)
November 30, 2024