daily pastebin goal
34%
SHARE
TWEET

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

cwchen Oct 7th, 2017 425 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top