Advertisement
cwchen

[Go] Adding to void interface values (with error)

Oct 7th, 2017
761
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Go 0.14 KB | None | 0 0
  1. package main
  2.  
  3. import (
  4.     "fmt"
  5. )
  6.  
  7. func main() {
  8.     var m interface{}
  9.     var n interface{}
  10.  
  11.     m = 3
  12.     n = 2
  13.  
  14.     // Error!
  15.     fmt.Println(m + n)
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement