3 ms·
> You can implement the Stringer interface for the type which prevents it from being logged and since it's private, code from outside of the module can't enumer
by lmm 1y ago
> You can implement the Stringer interface for the type which prevents it from being logged and since it's private, code from outside of the module can't enumerate it.
Those sound like decidedly non-structural features. And couldn't you undermine them by passing it to a function that expects a different `struct { pw string }` and logs its contents?
- b_e_n_t_o_n 1y agoOnly in the same module. Outside, it's effectively hidden. And yeah, structurally typed languages often have nominal features. They come in useful in a lot of scenarios! Unless you're talking about something like Clojure which is not statically typed.