Skip to content

Instantly share code, notes, and snippets.

@ijt ijt/splat.go
Created Oct 26, 2012

What would you like to do?
Argument splatting in Go
// See
package main
import "fmt"
func main() {
args := []int{1, 2, 3}
func sum(args int {
s := 0
for _, a := range(args) {
s += a
return s
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.