Closed dmitshur closed 9 years ago
Another reason why go generate
is nicer is because it allows one not to worry about current working directory.
I could just run go generate github.com/go-gl/mathg/...
and it'll always do the same thing (the go generate commands are always run from the directory where the Go package is located). While with genprog/main.go
, running it from genprog
folder will have different results than running it from mathgl
folder. So I need to spend more time to figure out what cwd should be...
Was this fixed by #39?
Yes, it's clean now, running go generate github.com/go-gl/mathgl/mgl32
produces no diff.
If I run
make
without any changes, it results in non-zero diff.Also,
genprog/main.go
is not at all mentioned in theMakefile
, so I assume you must be running it manually? According the README, that is how thevector.go
andmatrix.go
files are generated, so it should be a part of theMakefile
then. See https://github.com/go-gl/mathgl/commit/e3a647b55aa04a78f7d7d297939736c4900e842d#commitcomment-9978547.Finally, it's best to move away from Makefiles or other custom solutions for automation/generation and use a more standard
go generate
approach. The same commands will be executed, it's just a convention that is easier for everyone to follow. See https://github.com/go-gl/mathgl/issues/32#issuecomment-76653591.