How do you prefer to name generated files?

Hey, everybody!

I am confused how to name a generated file? I have got methods.go file already.
But I come up with an idea to generate some methods. But what name would fit a new file?

methods_generated.go - too verbose
gen_methods.go - not obvious
methods2.go - not verbose, not obvious

What practices do you follow?

Personally I like to name things descriptively according to what they contain. Like auth.go, userdata.go, etc. So that I can look at the project directory and know whats in those files from their names, but this is just my preferences.

1 Like

Coming with go1.9 is a standard way to indicate a file is generated:


Good point. The proposal does not affect the file name in any way, so the namel can be chosen freely (e.g. to describe its purpose or its content, as @CurtGreen suggests).

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.