Reputation: 3442
import (
"fmt"
"golang/pkg/closure"
"golang/pkg/player"
"golang/pkg/slices"
"golang/pkg/user"
)
Above you can see my imports in main
package. On same level with main.go
file , I have folder pkg
, where I hold my packages and file go.mod
module golang
go 1.18
How can make it working same way but without using golang/
prefix ?
Upvotes: 0
Views: 157
Reputation:
There is not a way to remove the module path from an import path.
You can, however, remove the pkg
folder from your directory structure and import paths.
Upvotes: 1