use-go 0.0.1

Feature-gated facade crate for RustUse Go ecosystem primitives
Documentation

use-go

Feature-gated facade crate for the RustUse Go ecosystem primitives.

Experimental

use-go is experimental while the workspace remains below 0.3.0. Expect small API adjustments during the first release wave.

Example

#[cfg(feature = "full")]
use use_go::{GoIdentifier, GoImportPath, GoModulePath, GoPackageName, GoTestName, GoVersion};

#[cfg(feature = "full")]
let version: GoVersion = "go1.22.0".parse()?;
#[cfg(feature = "full")]
let identifier = GoIdentifier::new("ServeHTTP")?;
#[cfg(feature = "full")]
let package = GoPackageName::new("http")?;
#[cfg(feature = "full")]
let import = GoImportPath::new("net/http")?;
#[cfg(feature = "full")]
let module = GoModulePath::new("example.com/project")?;
#[cfg(feature = "full")]
let test = GoTestName::new("TestHandler")?;

#[cfg(feature = "full")]
assert_eq!(version.to_string(), "1.22.0");
#[cfg(feature = "full")]
assert!(identifier.is_exported());
#[cfg(feature = "full")]
assert_eq!(package.as_str(), "http");
#[cfg(feature = "full")]
assert_eq!(import.as_str(), "net/http");
#[cfg(feature = "full")]
assert_eq!(module.as_str(), "example.com/project");
#[cfg(feature = "full")]
assert_eq!(test.as_str(), "TestHandler");
# Ok::<(), Box<dyn std::error::Error>>(())

Scope

  • Opt-in access to the focused Go primitive crates.
  • A small facade surface that avoids implementation logic.
  • Lightweight composition for docs tooling, CLIs, fixtures, and metadata models.

Non-goals

  • Adding behavior beyond the child crates.
  • Compiling, parsing, formatting, linting, testing, or executing Go code.
  • Resolving Go modules, packages, imports, or workspaces.
  • Shelling out to Go tooling.

Feature model

The default feature set enables full, which re-exports all focused crates. Disable default features and enable individual features such as version, identifier, module, or go-mod for a narrower dependency surface.

License

Licensed under either Apache-2.0 or MIT.