Code generated from protobufs:
public String getSomeId() {
if (someId_ instanceof String) {
return (String) someId_;
}
ByteString bs = (ByteString) someId_;
String s = bs.toStringUtf8();
if (isValidUtf8(bs)) {
someId_ = s;
}
return s;
}
vs.
func (m *SomeData) GetSomeId() string {
if m != nil && m.SomeId != nil {
return *m.SomeId
}
return ""
}
Which is easier to understand and be sure is correct?