Utils and helpers

Written by
Link to Post

https://www.reddit.com/r/golang/comments/bzdgx2/utils_and_helpers/ by 

Where do you put your miscellaneous functions? I have 1-2 methods, which are helpers for time.Time for e. g., but I cannot see where can I place them.

One (discouraged) way is to put it into a package called util/misc. The other way is to create a timeutil directory and timeutil.go file inside it. But it looks ugly: 1 new directory and a new file for ~20 lines of code.

submitted by /u/pihentagy
[link] [comments]

Article Tags:
· ·
Article Categories:

Leave a Reply