Recently, I am using IntelliJ IDEA
as a Go
IDE to browse Docker Swarm code. When I want to search where Discovery.Watch
method intoken package is called, the “Find usages
“(Alt+F7
) function of IntelliJ IDEA
gives me a confusion:
It just prints one occurrence: the test code of token
package. It doesn’t make sense, where the hell is the Discovery.Watch
method called? When I search the usages of Watch
in Watcher interface which token.Discovery
satisfies by accident, I catch where theDiscovery.Watch
method is used:
The caveat from this lesson is if you can’t find where methods of a package are called, you should try to find the interfaces where the packages satisfy, maybe it will give you the answer.
thanks for your sharing