title: golang reading a large number using bufio.NewScanner
body: <p>I tried to get the input (many number with space) and converted it to slice.
  number of numbers is up to 300,000</p>
  <p>I got an error and I googled it. and there's some problem with buffer size.
  so I wrote the code as below.</p>
  <pre><code>func ChangeToInt(input string) []int {
      var nums []int
      for _, word := range strings.Fields(input) {
          num, _ := strconv.Atoi(word)
          nums = append(nums, num)
      }
      return nums
  }
  
  scanner := bufio.NewScanner(os.Stdin)
  
  maxCapacity := 4*300000
  buf := make([]byte, maxCapacity)
  scanner.Buffer(buf, maxCapacity)
  
  scanner.Scan()
  input := scanner.Text()
  nums := ChangeToInt(input)  
  </code></pre>
  <p>but still not working. what's the problem?</p>