You can have local “sub” modules like you ask for by adding a require statement and a matching replace statement with a relative file path in go.mod.
In the “root” ./go.mod:
module example.com/localModule
require example.com/localModule/model v0.0.0
replace example.com/localModule/model v0.0.0 => ./model
Related Contents:
- Go update all modules
- missing go.sum entry for module providing package
- What does ‘incompatible’ in go.mod mean, will it cause harm?
- How to set GOPRIVATE environment variable
- How to upgrade the go version in a go mod
- Organize local code in packages using Go modules
- go mod: cannot find module providing package
- How to remove an installed package using go modules
- go module @latest found but does not contain package
- what is the purpose of `go mod vendor` command?
- How do I migrate from Dep to Go Modules
- What is the difference between go get command and go mod download command
- Concatenate two slices in Go
- Checking the equality of two slices
- Can I list all standard Go packages?
- How to import local packages in go?
- How to declare a constant map in Golang?
- How to add new methods to an existing type in Go?
- Are maps passed by value or by reference in Go?
- How to convert interface{} to string?
- What does go build build? (go build vs. go install)
- How do I import a specific version of a package using go get?
- What could happen if I don’t close response.Body?
- What is channel buffer size?
- What is the difference between int and int64 in Go?
- Is it possible to have nested templates in Go using the standard library?
- How to get error message in a string in golang?
- Call has possible formatting directive
- slice of struct != slice of interface it implements?
- Get name of struct field using reflection
- Why use the `go` keyword when calling a function?
- unknown field in struct literal
- Casting back to more specialised interface
- Why would a call to fmt.Sprint(e) inside the Error() method result in an infinite loop?
- Save and load crypto/rsa PrivateKey to and from the disk
- How to get yesterday’s date in golang?
- Can command line flags in Go be set to mandatory?
- Does it make sense to have two packages in the same directory?
- Relative imports in Go
- Why does vscode delete golang source on save
- How do we combine multiple error strings in Golang?
- How do I reverse sort a slice of integer Go?
- In Go, how to write a multi-line statement?
- Function in same package undefined
- Convert int32 to string in Golang
- Immutable Struct in Golang
- What does an empty select do?
- how to modify struct fields in golang
- Creating map with/without make
- Where is the module cache in golang?