use-go-import 0.0.1

Go import metadata primitives for RustUse
Documentation
  • Coverage
  • 56.41%
    22 out of 39 items documented1 out of 22 items with examples
  • Size
  • Source code size: 14.38 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 810.14 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 3s Average build duration of successful builds.
  • all releases: 3s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Homepage
  • RustUse/use-go
    1 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • CloudBranch

use-go-import

Go import metadata primitives for RustUse.

Experimental

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

Example

use use_go_import::{GoImportAlias, GoImportKind, GoImportPath, GoImportSpec};

let path = GoImportPath::new("net/http")?;
let alias = GoImportAlias::new("httpx")?;
let import = GoImportSpec::new(path, GoImportKind::Aliased).with_alias(alias);

assert_eq!(import.path().as_str(), "net/http");
assert_eq!(import.alias().map(GoImportAlias::as_str), Some("httpx"));
# Ok::<(), use_go_import::GoImportError>(())

Scope

  • Non-empty Go import paths.
  • Import aliases such as _, ., and ordinary identifiers.
  • Lightweight import kind and group labels.

Non-goals

  • Import resolution.
  • Package loading.
  • Contacting module registries or proxies.
  • Parsing Go source files.

License

Licensed under either Apache-2.0 or MIT.