Add section about use of underscores in file names to Go Code Review Comments

174 views
Skip to first unread message

konrad...@gmail.com

unread,
Feb 1, 2017, 5:26:02 PM2/1/17
to golang-nuts
Hey everyone,

this is something which has came up now a couple of times in the Gophers Slack so I am posting it here:

Would it make sense to add a section about how file names should look like? In particular, I would suggest that underscores should not be used unless for prefixing test files, platform specific builds or files which should be ignored altogether.

For instance: user_node.go vs. usernode.go

While the former is valid I mostly see the latter in bigger Go projects. It would help to point out that underscores should be used for test/platform specific cases.

In addition, it would prevent creating very long file names but rather choose short and descriptive file names to keep the filename short, compare web_controller/web_controller_handler.go to webcontroller/handler.go.

Would love to hear what others think about it and whether it would make sense to add this to the Go Code Review Comments [1].

Best,
Konrad

Dave Cheney

unread,
Feb 1, 2017, 7:07:30 PM2/1/17
to golang-nuts
I think both are symptomatic of following a Javaesq style of one type per file.

konrad...@gmail.com

unread,
Feb 2, 2017, 4:09:48 PM2/2/17
to golang-nuts
What both? What's the alternative?
Reply all
Reply to author
Forward
0 new messages