Answers for "switch in golang with string"

Go
0

Switch in golang

switch day {
  case "sunday":
    // cases don't "fall through" by default!
    fallthrough

  case "saturday":
    rest()

  default:
    work()
}
Posted by: Guest on December-29-2021

Browse Popular Code Answers by Language