Short Declairation

Assuming x is declared and y is not declared, which clauses below are correct?

  1. x, _ := f()
  2. x, _ = f()
  3. x, y := f()
  4. x, y = f()

Answer

  1. x, _ := f() //incorrect
  2. x, _ = f() //correct
  3. x, y := f() //correct
  4. x, y = f() //incorrect