On 10/24/19 7:49 PM, Nick Rosbrook wrote: >> One standard practice when making a series is to try to avoid any >> regressions, including build regressions, in the middle of the series. >> This is particularly helpful to aid in bisections, but in this case it >> makes it easier to observe the action of the `gengotypes.py` script (and >> how it's meant to be called). >> >> So I would basically make this part of patch 2, except remove references >> to xenlight_helpers.go until the patch where that file is generated. > > Ah yeah that makes sense, I'll correct this in v2. > >> It might be nice to have a naming convention for the generated files >> that clues people in to the fact that they're generated (other than the >> comment at the top of course). In libxl, this is done by giving them a >> leading underscore (e.g., _libxl_type.h); but the go compiler will >> helpfully ignore such files. :-) >> >> The go compiler will also do special things sometimes with things after >> a `_`; e.g., "${foo}_test.go" will only be compiled for `go test`, >> "${foo}_linux.go" will only be compiled on Linux, and so on. I'm pretty >> sure these names will be safe, but it might be slightly more >> future-proof to avoid using an underscore in the names. > > +1 for a naming convention that says "this file is generated." But, > the only special > cases that I'm aware of for go file name suffixes are "test", and > valid GOOS and GOARCH > values. It's conventional to use underscores for compounded file > names, and unnecessary > to avoid them. > > To reference gRPC again, their protobuf compiler writes file names > like 'package.pb.go', where > pb is short for protobuf. So, I think something like > '<name>_generated.go', or '<name>.idl.go' > could work.
Both of those are OK. I might go with "gen_*.go" to be a bit shorter, or ".idlgen.go" to make it clear that this is /generated from/ and idl, and not an idl itself. But I don't have strong opinions; any of those four options would be fine with me. -George _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel