Go module overrides
Go module replacement
Section titled “Go module replacement”The --replace flag keeps a dependency’s name and takes its code from elsewhere, e.g. to source a dependency from a fork, or to pin a version another dependency pulls in.
the name you importlis add gorilla/mux --replace you/muxwhere the code comes fromThe replacement is recorded in the manifest:
[dependencies.go]"github.com/gorilla/mux" = { replacement = "github.com/you/mux@v1.9.0" }The replacement is transparent to your code:
import "go:github.com/gorilla/mux"To undo the replacement, re-add the dependency without --replace.
Go module on disk
Section titled “Go module on disk”A Lisette project can depend on a Go module located on disk, for local development:
Directorymy-lis-app/
- lisette.toml
Directorysrc/
- main.lis
Directorymy-go-app/
- go.mod module
example.com/example/my-go-app - main.go
- go.mod module
Pass the Go module’s root dir to the --path flag:
cd my-lis-applis add --path ../my-go-appThe local Go module is recorded in the manifest:
[dependencies.go]"example.com/example/my-go-app" = { path = "../my-go-app" }Import it using the module path in its go.mod:
import "go:example.com/example/my-go-app"As you edit the local Go module, run lis check in your Lisette project to regenerate the Go module’s typedefs.
Once the Go module is published, use lis add to depend on the published module. Its import path stays the same, so no source changes.