Create new Package

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

Understanding Package Visibility in Go | DigitalOcean

Import package

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.modmodule

Example:

(Structure)

(Code - main.go)

package main

import (
	packageName "<ProjectName>/Foldername",
	user "example/models"
)