pub trait GoBuildEnv {
// Required methods
fn go_list(
&self,
root: &Path,
tuple: &TargetTuple,
) -> Result<String, GomodError>;
fn read_file(&self, path: &Path) -> Result<Vec<u8>, GomodError>;
}Expand description
The Environment seam — the ONLY place the encoder touches the world.
Real builds shell go list + read files; tests mock both.
Required Methods§
Sourcefn go_list(
&self,
root: &Path,
tuple: &TargetTuple,
) -> Result<String, GomodError>
fn go_list( &self, root: &Path, tuple: &TargetTuple, ) -> Result<String, GomodError>
Run go list -deps -json for the tuple over the module at root,
returning the concatenated-JSON-object stream. MUST be hermetic
(-mod=vendor, GOPROXY=off) on the real impl.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".