Last active
October 5, 2017 04:04
-
-
Save KushNee/9d149536a31b62aeef9e9e6abf665a72 to your computer and use it in GitHub Desktop.
golang-snippets
This file contains 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
/*接口变量类型判断标准*/ | |
if v, ok := varI.(T); ok { // checked type assertion | |
Process(v) | |
return | |
} | |
// varI is not of type T |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment