You can't allocate a variable-sized array, but you can allocate a slice.
var d []int = make([]int, flag.NArg());
or more idiomatically
d := make([]int, flag.NArg());
See also http://golang.org/doc/effective_go.html#slices
Enjoy!Russ