On Thu, Jun 20, 2019 at 5:25 PM Gert <gert.cuyk...@gmail.com> wrote: > > Trying to get my mind around why the private() function is necessary here. I > fail to understand the comment provided > > type Geometry interface { > GeoJSONType() string > Dimensions() int // e.g. 0d, 1d, 2d > Bound() Bound > > // requiring because sub package type switch over all possible types. > private() > } > > https://github.com/paulmach/orb/blob/master/geometry.go#L10
Some packages use an unexported method like this to ensure that no type defined outside of the package can implement the interface. Ian -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/CAOyqgcWOCJTZHEFPRRyRXW%3DxXq4QgnOO26aSieF25NZZkibsrQ%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.