Skip to content

Instantly share code, notes, and snippets.

@xvbnm48
Created March 4, 2022 14:02
Show Gist options
  • Save xvbnm48/21b12a65e44a09cb7c5dec9a9473fa16 to your computer and use it in GitHub Desktop.
Save xvbnm48/21b12a65e44a09cb7c5dec9a9473fa16 to your computer and use it in GitHub Desktop.
switch golang
package main
import "fmt"
func main(){
nilai := 3
switch nilai {
case 1:
fmt.Println("nilai 1")
case 2:
fmt.Println("nilai 2")
case 3:
fmt.Println("nilai 3")
default:
fmt.Println("nilai tidak diketahui")
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment