The fmt package has a Scan function that reads stdin, and writes consecutive space separated values to the variables you provide. Is there a way to use this with Slices, so that I could create a slice of sice n, and have scan read n values and put them into the slice?
- You can use bytes.Buffer or bytes.Reader for this purpose. These struct are specifically designed for the purpose you have.fuz– fuz2013-06-05 09:55:18 +00:00Commented Jun 5, 2013 at 9:55
Add a comment |