Created
November 29, 2013 17:05
-
-
Save asmedrano/7708817 to your computer and use it in GitHub Desktop.
A slice of interfaces to args?
This file contains hidden or 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
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