3 ms·
I'm not sure if this is wholly idiomatic. I based it on the following from "Effective Go" [1]: > There's nothing wrong with providing getters and setters yours
by carbocation 13y ago
I'm not sure if this is wholly idiomatic. I based it on the following from "Effective Go" [1]:
> There's nothing wrong with providing getters and setters yourself, and it's often appropriate to do so, but it's neither idiomatic nor necessary to put Get into the getter's name.
Since I view "is/has" as derivatives of "get", I opted to omit the "is" from Guest(). But I'm open to hearing other opinions.
There is probably plenty that is un-idiomatic all over this code and one of the reasons I put it out there is to get feedback.
1 = http://golang.org/doc/effective_go.html#Getters http://golang.org/doc/effective_go.html#Getters
- deleted 13y ago[deleted]
- mseepgood 13y ago"GetX" is not idiomatic, but "IsX" seems to be idiomatic: http://golang.org/pkg/net/#IP.IsGlobalUnicast http://golang.org/pkg/net/#IP.IsGlobalUnicast