Closed zbisch closed 6 years ago
Yes, it's a bug in the upstream gomacro. Thanks for the report, I fixed this issue in b632224d66228467119da53a6fb81365ca1b8551
You may want to know that the following does not work yet:
f := (*sync.WaitGroup).Done
i.e. extracting a function func(*<receiver>, ...) ...
from a method with pointer receiver.
It's a known bug, I will fix it when I have a little time.
As a workaround, the following instead works in gophernotes - even though it's not accepted by Go compilers:
f := sync.WaitGroup.Done
Greetings, I just started using gophernotes, so my apologies if this issue is already known (I did try searching through previous issues for anything similar). Also, this issue may be one upstream with gomacro, though I couldn't find anything there either.
In my code, I was trying to use sync.WaitGroup to synchronize my worker pools before moving on to the next phase, but ran into some strange errors. Here's a simplified example of the troubles I was having:
The error message I get is:
repl.go:9:3: type sync.WaitGroup has no field or method "Done": wg.Done
If I remove the calls to Done() in the two goroutines, then I get the error below:
repl.go:17:2: not a package: "wg" in wg.Add <*ast.SelectorExpr>
I was able to build/run the code using the standard Go compiler.