Application
Create new folder named src. In src folder, create new file named main.go as below:
package main
import "fmt"
func main() {
var finger int = 3
if finger == 1 {
fmt.Println("Thumb")
} else if finger == 2 {
fmt.Println("Index")
} else if finger == 3 {
fmt.Println("Middle")
} else if finger == 4 {
fmt.Println("Ring")
} else if finger == 5 {
fmt.Println("Pinky")
} else {
fmt.Println("Invalid")
}
}
Output
Open Terminal windows in Visual Studio Code and run command line: go run main.go
Middle