Created
October 24, 2020 12:42
-
-
Save thiagozs/9c0289ace38844ea406fdaf259a9452c to your computer and use it in GitHub Desktop.
String check with equal fold
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"strings" | |
) | |
var ( | |
ASK_SIDE = "ask" | |
BID_SIDE = "bid" | |
) | |
func main() { | |
side := "BiD" | |
switch { | |
case strings.EqualFold(side, BID_SIDE): | |
fmt.Println("switch bid_side:", BID_SIDE) | |
case strings.EqualFold(side, ASK_SIDE): | |
fmt.Println("switch ask_side:", ASK_SIDE) | |
default: | |
fmt.Println("unknown:", side) | |
return | |
} | |
fmt.Println("Hello, playground") | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment