cheekybits / genny

Elegant generics for Go
MIT License
1.71k stars 126 forks source link

genny leaves around an empty file on failure. #23

Closed james-lawrence closed 6 years ago

james-lawrence commented 8 years ago

if genny fails to generate a code due to not being able to locate the file. it still generates a empty file leading to subsequent calls to fail with the follow error btree.gen.go:1:1: expected 'package', found 'EOF'

should probably not create the file until we are ready to write its contents.

pdrum commented 6 years ago

@matryer @tylerb May I make a PR for it?

The empty files become troublesome, especially since they should be deleted one by one in order for me to be able to run genny again. (Otherwise it logs expected 'package', found 'EOF')

matryer commented 6 years ago

@pdrum please do - sorry, this repo isn't as actively maintained as we would like.

matryer commented 6 years ago

@pdrum would you like to become a maintainer?

pdrum commented 6 years ago

Sure, that would be nice.

pdrum commented 6 years ago

@matryer https://github.com/cheekybits/genny/pull/51 should resolve this.

pdrum commented 6 years ago

Fixed in https://github.com/cheekybits/genny/pull/52