News for hackers. Stuff that matters.
Re:Why I Don't Like Golang (2016) by BreakfastB0b on Tuesday June 14, 2022 @02:33AM (#31735434)
It's not great, but I use this pattern to check / enforce interface membership.

  type Bar interface {
     BarMethod(int, int) int
  }

  type Foo struct {}

  // Error: Foo does not implement Bar (missing method BarMethod)
  var _fooImplementsBar Bar = Foo{}

There are no comments on this comment yet.