Third-party Go modules
Adding a module
Section titled “Adding a module”To add a third-party module as a dependency to your project:
lis add google/uuidlatest versionlis add google/uuid@v1.6.0exact versionlis add google/uuid@2d3c2a9exact commit hash or branchlis add go.uber.org/zapfull path for a non-GitHub hostExample output:
✓ Added go.uber.org/zap v1.28.0 └─ go.uber.org/multierr v1.10.0lis add will:
- download the Go module to
~/go/pkg/mod, - generate typedefs at
target/.lisette/typedefs, and - declare the module and its transitives in the
lisette.tomlmanifest.
[dependencies.go]"go.uber.org/zap" = "v1.28.0""go.uber.org/multierr" = { version = "v1.10.0", via = ["go.uber.org/zap"] }lis add does not generate every typedef up front. Typedefs for packages no import reaches are generated on demand, when you write the import.
Importing a module
Section titled “Importing a module”To import a third-party module:
import "go:go.uber.org/zap"
fn main() { let logger = zap.NewExample() logger.Info("hello")}The imported module must be listed in your project manifest.
Tidying the manifest
Section titled “Tidying the manifest”To tidy up the manifest:
lis syncThis reconciles lisette.toml against state on disk. Run lis sync after removing imports, deleting source files, or pulling new code.
Removing a module
Section titled “Removing a module”To remove a dependency:
- Delete the entry from
lisette.toml - Run
lis sync