Create Folder with the Package-Name and create there a File with the same name. (If the Folder and the File name different, than the package-name is the folder-name)
go mod init projectName/packageName
main.go
package main
...
packageName
packageName.go
package packageName
...
Understanding Package Visibility in Go | DigitalOcean
If you can’t import the package, you must to declare the import by self.
import (
"projectName/packageName"
)
If the Folder has a other name than the package, you must import the folder-name:
The Projectname you will find in the go.mod
→ module
(Structure)
(Code - main.go)
package main
import (
packageName "<ProjectName>/Foldername",
user "example/models"
)