#naming convention for libraries associated with standalone programs

5 messages · Page 1 of 1 (latest)

raw kiln
#

Hey, I would probably go with the latter.
You probably want to go with something like this:

.
├── cmd
│  └── main.go
└── internal
   └── foo
      └── foo.go

Where the package name on foo.go is package foo and in main.go you would have package main .

#

You can also have foo directory in the project root or inside a pkg folder.

#

Dave Cheney: internal/ is a special directory name recognized by the go tool which will prevent one package from being imported by another unless both share a common ancestor.

raw kiln
#

Hey, if this was a satisfactory answer, please mark it as solved.