use-go-mod 0.0.1

go.mod metadata primitives for RustUse
Documentation
1
2
3
4
5
6
7
8
9
10
use use_go_mod::{GoModDirective, GoModFile, GoModModuleDirective};
use use_go_module::GoModulePath;

fn main() -> Result<(), use_go_module::GoModuleError> {
    let module = GoModModuleDirective::new(GoModulePath::new("example.com/project")?);
    let file = GoModFile::new().with_directive(GoModDirective::Module(module));

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