-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Issue] Compile Error: misplaced compiler directive #8
Comments
这个错误通常是在使用 可以尝试使用 $ go run -toolexec decorator -a main.go This error is usually caused by compiling the code before using Try forcing a recompile with the $ go run -toolexec decorator -a main.go |
相同的源码,还是无法通过编译. 你可以尝试复现吗? $ go run -toolexec decorator -a main.go
# command-line-arguments
./main.go:22: misplaced compiler directive
command-line-arguments: open /var/folders/3g/8n4r6n1d5b1fz6phh1rpfmx80000gp/T/go-build2815434048/b001/_pkg_.a: no such file or directory
|
看报错似乎不是 decorator 的问题。使用 |
I tried to use nested annotations, a compilation error was reported, and the error message was not enough for me to locate the problem.
When I changed the location of the function in the source code, the problem disappeared.
Source Code
output
Enviroment
go version go1.22.5 darwin/arm64
The text was updated successfully, but these errors were encountered: