Skip to content
/ mod Public

A package for finding and manipulating go.mod files.

License

Notifications You must be signed in to change notification settings

livebud/mod

Repository files navigation

Mod

Go Reference

A package for finding and manipulating go.mod files.

Features

  • Recursively traverses up the filesystem looking for go.mod
  • Supports resolving import paths to directories
  • Supports resolving directories to import paths
  • Extracted from Bud

Install

go get github.com/livebud/mod

Example

func main() {
  module, err := mod.Find(".")
  if err != nil {
    fmt.Fprintln(os.Stderr, err)
    os.Exit(1)
  }
  fmt.Println(module.Dir())
  fmt.Println(module.Import())
}

Contributors

License

MIT

About

A package for finding and manipulating go.mod files.

Resources

License

Stars

Watchers

Forks

Packages

No packages published