Re: [go-nuts] public interface with private method: totally dubious ? In which case is it useful ?

2017-09-04 Thread Ian Davis
It's a pattern that can be used to prevent external implementations of the interface. Another example is the text/template package in the standard library: https://github.com/golang/go/blob/master/src/text/template/parse/node.go#L21 On Mon, 4 Sep 2017, at 01:21 PM, mhhc...@gmail.com wrote: > hi,

[go-nuts] public interface with private method: totally dubious ? In which case is it useful ?

2017-09-04 Thread mhhcbon
hi, in this code https://github.com/conformal/gotk3/blob/7a6ce3ecbc883d4d6a7aa1821bbc9633751fd67e/gtk/gtk.go#L7926 a public interface with a private method is declared. At first read, totally dubious. yeah? A bit more testing, and i wonder in which case this is suitable, a basic example