Skip to content

Instantly share code, notes, and snippets.

@KushNee
Last active October 5, 2017 04:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save KushNee/9d149536a31b62aeef9e9e6abf665a72 to your computer and use it in GitHub Desktop.
Save KushNee/9d149536a31b62aeef9e9e6abf665a72 to your computer and use it in GitHub Desktop.
golang-snippets
/*接口变量类型判断标准*/
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