Skip to content

Third-party Go modules

To add a third-party module as a dependency to your project:

Terminal window
lis add google/uuidlatest version
lis add google/uuid@v1.6.0exact version
lis add google/uuid@2d3c2a9exact commit hash or branch
lis add go.uber.org/zapfull path for a non-GitHub host

Example output:

✓ Added go.uber.org/zap v1.28.0
└─ go.uber.org/multierr v1.10.0

lis add will:

  1. download the Go module to ~/go/pkg/mod,
  2. generate typedefs at target/.lisette/typedefs, and
  3. declare the module and its transitives in the lisette.toml manifest.
[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.

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.

To tidy up the manifest:

Terminal window
lis sync

This reconciles lisette.toml against state on disk. Run lis sync after removing imports, deleting source files, or pulling new code.

To remove a dependency:

  • Delete the entry from lisette.toml
  • Run lis sync