ebitengine / purego

Apache License 2.0
1.94k stars 63 forks source link

internal/fakecgo: clean up gen.go #235

Closed TotallyGamerJet closed 2 months ago

TotallyGamerJet commented 2 months ago

The go generate command adds the generate build tag when searching for pragmas to run. This means the pragma doesn't need to be in a separate file.

I also moved formatting into the code itself using the go/format package and cleaned up the code into a template.

TotallyGamerJet commented 2 months ago

I don't think many people use go:build generate as a normal build tag outside of go generate but I don't know how to search all public repos for it.

I can put it back if you want. The only thing is doing it that way means only darwin and freebsd can generate it since the doc.go has a build tag. It has one so that it is a compilation error to import fakecgo on other platforms. I can add linux though.

hajimehoshi commented 2 months ago

Sure, let's put it back to //go:build ignore. Thanks,