[go-nuts] Re: Hide struct fields from frontend code (JSON REST API)

2016-11-30 Thread Tahir Hashmi
It would be easier to do: type User struct { Name string `json:"name"` } type PrivateUser struct { User Password string `json:"password"` } See https://play.golang.org/p/2VlGgRlrP1 On Wednesday, November 30, 2016 at 2:42:19 PM UTC+5:30, Mirco Zeiss wrote: > > Maybe I'll just wait for go 1.8

Re: [go-nuts] Re: Thinking OO virtual function in Go

2016-11-23 Thread Tahir Hashmi
On Wednesday, November 23, 2016 at 8:21:23 PM UTC+5:30, Tong Sun wrote: > I've tried to derive how to achieve a) implementation inheritance, >> followed by b) type substitution and c) enabling dynamic dispatch as in >> virtual functions in my blog post here: >>

[go-nuts] Re: Thinking OO virtual function in Go

2016-11-23 Thread Tahir Hashmi
I've tried to derive how to achieve a) implementation inheritance, followed by b) type substitution and c) enabling dynamic dispatch as in virtual functions in my blog post here: https://tech.t9i.in/2014/01/22/inheritance-semantics-in-go/ I also like the approach suggested by Sebastien Binet.