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.moddirective 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.modparsing. - Module resolution.
- Shelling out to
go mod. - Contacting module registries or proxies.
§License
Licensed under either Apache-2.0 or MIT.
Structs§
- GoMod
Exclude Directive excludedirective metadata.- GoMod
File - Lightweight
go.modfile metadata. - GoMod
GoDirective godirective metadata.- GoMod
Module Directive moduledirective metadata.- GoMod
Replace Directive replacedirective metadata.- GoMod
Require Directive requiredirective metadata.- GoMod
Retract Directive retractdirective metadata.- GoMod
Toolchain Directive toolchaindirective metadata.
Enums§
- GoMod
Config File go.modconfig file kind.- GoMod
Directive go.moddirective metadata.- GoMod
Error - Error returned when parsing
go.modmetadata labels fails.