|
|
|
|
|
by ridiculous_fish
3845 days ago
|
|
When navigating unfamiliar Go codebases, it's hard to know which types fulfill an interface. Say you have a function that takes an Animal; how do you figure out what to call it with? Or to give a concrete example, say you want to do formatted output to stderr. How is one supposed to determine that os.Stderr is something that can be passed to fmt.Fprintf? Is there a better way than manually comparing method signatures? |
|
Plus you get interface implementation checking, so your error messages actually make sense if the interface or type method signatures unexpectedly change.
Again, this is not a real solution to your problem, but it has enough advantages to be worth mentioning.