progrium / darwinkit

Native Mac APIs for Go. Previously known as MacDriver
MIT License
4.4k stars 146 forks source link

Generating appkit problem with enumtypes.gen.go and aliastypes.gen.go #237

Open programmingkidx opened 6 months ago

programmingkidx commented 6 months ago

After running 'go generate ./macos/appkit' in a cloned DarwinKit repo, the files enumtypes.gen.go and aliastypes.gen.go are created. When I try to run my test program I see this error:

package command-line-arguments
    imports github.com/progrium/macdriver/macos/appkit
    imports github.com/progrium/macdriver/macos/appkit: import cycle not allowed

Further investigation shows that both files import "github.com/progrium/macdriver/macos/appkit". This is an error because both files are located in the appkit package already. Both files do not use this import.

There is also the problem with enumtypes.gen.go where it tries to use methods from the math package without importing that package.

My info:

progrium commented 3 weeks ago

Do you have goimports in your PATH? Did you see it complain about goimports at the end of go generate ./macos/appkit? It runs this to fix these issues, but if it's not set up it won't fix them.