Closed dmitshur closed 9 years ago
regarding issue #46, i ran go run codegen.go -template matrix.tmpl -output matrix.go
which didnt generate mgl64. go generate
didn't fail to generate mgl64, I ran the wrong command.
Makes sense.
Hopefully this will improve the situation a little by making it easier to run go generate
, no need to worry about accidentally running it on the mgl64
package (if you forget if you should or should not) and getting an error message.
Can this be merged?
ya, SGTM, :shipit:
Currently, the standard way to generate this repo is to run
go generate github.com/go-gl/mathgl/mgl32
. It generates parts of mgl32 package, and all of mg64 package. In the process of generating mg64, it copies over the go generate directives. But they are invalid, and runninggo generate github.com/go-gl/mathgl/mgl64
produces an error. Doing that should be a safe no-op.This change fixes that by replacing "//go:generate " directives with a disabled version "//#go:generate " when copying over mgl32 files to mgl64 package.
As a result, doing
go generate github.com/go-gl/mathgl/...
works as expected without problems and correctly generates all packages in this repo.Hopefully it'll help avoid issues like https://github.com/go-gl/mathgl/pull/46#issuecomment-133938858 and make contributing slightly easier.