Go modules question

80 views
Skip to first unread message

joseph.p...@gmail.com

unread,
Aug 16, 2023, 10:09:51 PM8/16/23
to golang-nuts
I’m reading a GO book for beginners.  They’re always naming their module in the form:

Is the ‘github.com’ portion of the module name mandatory? I really have no intention of saving my code to github. If i’m saving my code locally, can i use an arbitrary module name?

Thanks

Kurtis Rader

unread,
Aug 16, 2023, 10:20:48 PM8/16/23
to joseph.p...@gmail.com, golang-nuts
No, github.com as a prefix is not mandatory. Not even if you intend to publish your module. See https://go.dev/doc/modules/managing-dependencies#naming_module 

--
Kurtis Rader
Caretaker of the exceptional canines Junior and Hank
Reply all
Reply to author
Forward
0 new messages