#Hyphens or Underscores in directory names

8 messages · Page 1 of 1 (latest)

wispy glade
#

Using hyphens or underscores (- or _) for folder paths in Go - I wasn't sure what was best. I know that in Python using "-" can cause problems when importing things or something (its been a while but I remember having issues.

In go you can alias things if it includes hyphens and replaces it with an underscore which is pretty interesting.

Presumably using a hyphen is the recommended method since there seems to be workarounds?

Thanks

dusky summit
#

this might seem like a skirt, but honestly i find it more common for words to just be smooshed together

#

as you noted, it doesn't really matter at the end of the day. but the convention for go names—variables, functions, types, and yes, packages—often leans shorter and less verbose than other languages

#

examples from the standard library: expvar, hash/maphash, index/suffixarray, mime/quotedprintable, net/http/httptest, text/tabwriter, etc.

#

no hyphens or underscores found 🙂

wispy glade
#

Ah ok interesting, thank you. Currently I just hyphens but might smoosh things together for future things 🙂

true gazelle
wispy glade
#

sounds about right - I've got to get used ot the different type of camel case for the different types but at the moment just using the standard one while I get used to things (and probably do the edits later hopefully)