Skip to main content

Crate use_go_mod

Crate use_go_mod 

Source
Expand description

§use-go-mod

go.mod metadata primitives for RustUse.

§Experimental

use-go-mod is experimental while use-go remains below 0.3.0.

§Example

use use_go_mod::{GoModDirective, GoModFile, GoModModuleDirective};
use use_go_module::GoModulePath;

let module = GoModModuleDirective::new(GoModulePath::new("example.com/project")?);
let file = GoModFile::new().with_directive(GoModDirective::Module(module));

assert_eq!(file.directives().len(), 1);

§Scope

  • go.mod directive metadata.
  • Module, Go, toolchain, require, replace, exclude, and retract directive models.
  • Metadata-only structures built from focused Go version and module primitives.

§Non-goals

  • Complete go.mod parsing.
  • Module resolution.
  • Shelling out to go mod.
  • Contacting module registries or proxies.

§License

Licensed under either Apache-2.0 or MIT.

Structs§

GoModExcludeDirective
exclude directive metadata.
GoModFile
Lightweight go.mod file metadata.
GoModGoDirective
go directive metadata.
GoModModuleDirective
module directive metadata.
GoModReplaceDirective
replace directive metadata.
GoModRequireDirective
require directive metadata.
GoModRetractDirective
retract directive metadata.
GoModToolchainDirective
toolchain directive metadata.

Enums§

GoModConfigFile
go.mod config file kind.
GoModDirective
go.mod directive metadata.
GoModError
Error returned when parsing go.mod metadata labels fails.