Advertisement
Guest User

Untitled

a guest
May 27th, 2015
284
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Go 0.20 KB | None | 0 0
  1. type MyType struct {
  2.     Neco int
  3.     Dalsi int
  4. }
  5.  
  6. func (m *MyType) Add() {
  7.     return m.Neco + m.Dalsi
  8. }
  9.  
  10. my := &MyType {
  11.     Neco = 1
  12.     Dalsi = 2
  13. }
  14.  
  15. fmt.Printf("%v+%v = %v", my.Neco, my.Dalso, my.Add())
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement