any way to pass in arbitrary slices into a function?

134 views
Skip to first unread message

Lax Clarke

unread,
Sep 23, 2016, 12:13:32 AM9/23/16
to golang-dev
Hi,

Is there a way to create a function that slices of any type?

e.g.,  

func F(argument []interface{}) 


But in above, if I call F with a slice of integers, for example, the compiler complains of type mismatch.

Brad Fitzpatrick

unread,
Sep 23, 2016, 12:29:15 AM9/23/16
to Lax Clarke, golang-dev
The mailing list you're looking for is golan...@googlegroups.com, not golang-dev.


--
You received this message because you are subscribed to the Google Groups "golang-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-dev+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages