> Mostly trying to improve the UX by avoiding generated code clutter during 
> development. I concede that storing all your generated code in one directory 
> inside your project isn't that big of a deal. Another solution could be to 
> configure your editor to hide the generated directory.

Either that or, assuming you have some sort of visual tree view, to
show generated files in italics or some such. Or to have generated
files not be included in fuzzy finder results. There are many
approaches.

> Yah, exactly. The CLI wraps "go run" anyway, so there's a place to generate 
> code on new machines before starting the program.

So this is a tool you are writing for other developers? I'm further
assuming the generated code is critical to code they are then writing.
If so, this surely must be committed with whatever code they are
writing? In which case, generating this to anywhere other than the
place where they are writing code is a problem. But then I might have
totally misunderstood what you are doing here, in which case can you
explain a bit more?

> > In which case replace directives with a directory target is most likely 
> > your best solution:
>
> Replace is an interesting idea. I think replace would work well if there was 
> a standard place to put generated code outside of your project. I guess 
> that's what I'm looking for: a standard place to hide away generated code 
> until you care about it and want to vendor it. And when you do want to vendor 
> it, you can use the same code paths as your third-party dependencies.

There is nothing stopping you coming up with your own convention here,
or indeed retaining the convention of using
GOPATH/src/github.com/my/repo etc. Tools like gohack
(https://github.com/rogpeppe/gohack) do just that: establish a
convention.


Paul

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/CACoUkn5oN6AkcTn9_qo5H3H868100D6Qqzry5mNO%2Ba-3M%3DK4Ng%40mail.gmail.com.

Reply via email to