Question: I have a line containing 3 numbers that I want to read from stdin with fmt.Scanln() but this code won't work: 

```
X := make([]int, 3)
fmt.Scanln(X...)
fmt.Printf("%v\n", X)

```

I get this error message: 

```
cannot use X (type []int) as type []interface {} in function argument

```

I don't get it.

Answer: 
Idiomatic Go would be:

```
func read(n int) ([]int, error) {
  in := make([]int, n)
  for i := range in {
    _, err := fmt.Scan(&in[i])
    if err != nil {
       return in[:i], err
    }
  }
  return in, nil
}

```

`interface{}` means nothing. Please don't use it if you don't have to.
I saw in a comment you said the lines can have different lengths. In that case
you can implement your own `fmt.Scanner`:

```
package main

import (
   "bytes"
   "fmt"
)

type slice struct {
   tok []int
}

func (s *slice) Scan(state fmt.ScanState, verb rune) error {
   tok, err := state.Token(false, func(r rune) bool { return r != '\n' })
   if err != nil { return err }
   if _, _, err := state.ReadRune(); err != nil {
      if len(tok) == 0 {
         panic(err)
      }
   }
   b := bytes.NewReader(tok)
   for {
      var d int
      _, err := fmt.Fscan(b, &d)
      if err != nil { break }
      s.tok = append(s.tok, d)
   }
   return nil
}

func main() {
   var s slice
   fmt.Scan(&s)
   fmt.Println(s.tok)
}

```

<https://golang.org/pkg/fmt#Scanner>