Skip to content

Instantly share code, notes, and snippets.

@canthefason
Created June 23, 2015 21:26
Show Gist options
  • Save canthefason/f4be2c15c7ef210a3d34 to your computer and use it in GitHub Desktop.
Save canthefason/f4be2c15c7ef210a3d34 to your computer and use it in GitHub Desktop.
Some reflection tips
// for checking if an operand implements Context interface
contextType := reflect.TypeOf((*context.Context)(nil)).Elem()
mtype.Implements(contextType)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment