Skip to content

Instantly share code, notes, and snippets.

@berfarah
Created October 1, 2018 21:24
Show Gist options
  • Save berfarah/3ab51413a2628110c76287186c82eb6a to your computer and use it in GitHub Desktop.
Save berfarah/3ab51413a2628110c76287186c82eb6a to your computer and use it in GitHub Desktop.
Iterative Optimization on Hot Paths: Planning it out: Wrangling Go interfaces
type Descriptor struct {
Tags TagSet // struct tags
Type reflect.Type // the original type
Kind reflect.Kind // the underlying kind
Ptr bool // whether or not it's a ptr
}
// For a given column:
var valuer driver.Valuer = column.Descriptor.Valuer(reflect.ValueOf(""))
var scanner sql.Scanner = column.Descriptor.Scanner()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment