News for hackers. Stuff that matters.
Re:Eight years of Go by cube2222 on Friday November 10, 2017 @03:39PM (#15672786)
I actually experienced the opposite. Interfaces in go work so well, partly because you can create an interface which automatically gets satisfied by existing structures. For example I often use a requestDoer interface which only has the http clients "Do" method.

I'm using Goland so I have jump to interface from any structure implementing it. So that's another one that gets solved by tooling.

The structurally typed interfaces are actually my favorite part about Go probably.

Re:Eight years of Go by terminalcommand on Friday November 10, 2017 @03:59PM (#15672984)
How do you jump to the interface from any structure implementing it? Beside from comments there is no immediate way to which interface/interfaces a structure is implementing.

Maybe Gogland solves this by keeping records on all interfaces, and checking all structures whether they satisfy them. If that's the case, this is definitely solved by tooling.

Re:Eight years of Go by sythe2o0 on Friday November 10, 2017 @04:15PM (#15673108)
If you need this, you can write type assertion lines in a var block of the interfaces that you explicitly want to implement (and this will throw compile time errors if they don't).
Re:Eight years of Go by slrz on Friday November 10, 2017 @05:27PM (#15673598)
The standard godoc documentation browser does this too when started with the -analysis option. They all use the same source code oracle functionality available from the x/tools repo.
Re:Eight years of Go by cube2222 on Friday November 10, 2017 @06:51PM (#15674089)
No, Goland actually doesn't use that, they're rolling their own for everything.
Re:Eight years of Go by slrz on Saturday November 11, 2017 @03:52PM (#15678125)
Thanks for the correction. I think that's somewhat unfortunate, though. The powerful shared tooling is one of the strengths of the Go ecosystem and if there are issues with it that prevent the use in Goland I'd rather see those get fixed.

OTOH, they (Jetbrains) probably have shared infrastructure (between languages) within their IDE code base, too, and are more comfortable using their existing tooling.

Re:Eight years of Go by cube2222 on Saturday November 11, 2017 @06:12PM (#15678720)
They are actually parsing the code into their custom ast format, so they have a lot of things done out of the box already.
Re:Eight years of Go by cube2222 on Friday November 10, 2017 @04:14PM (#15673100)
That's exactly what it does as far as I know.

EDIT: I can also search for any interface with a struct selected, and generated stubs for all method. Well, basically what you get for any other language when implementing interfaces.