Skip to content

Instantly share code, notes, and snippets.

@asmedrano
Created November 29, 2013 17:05
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 asmedrano/7708817 to your computer and use it in GitHub Desktop.
Save asmedrano/7708817 to your computer and use it in GitHub Desktop.
A slice of interfaces to args?
package main
import "fmt"
import "reflect"
func main() {
a := []interface{}{1,3,4,5,"!@"}
dothis(a...)
}
func dothis(things ...interface{}) {
for i:=0; i<len(things);i++{
print(reflect.TypeOf(things[i]))
}
}
func print(things ...interface{}) {
fmt.Println(things)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment