Fix Go packages when using Go modules (#351)

This commit is contained in:
Roey Darwish Dror
2020-02-29 16:30:31 +02:00
committed by GitHub
parent d01aff7abd
commit 9c98005c61
2 changed files with 20 additions and 1 deletions

View File

@@ -101,6 +101,21 @@ impl Executor {
self self
} }
/// See `std::process::Command::remove_env`
pub fn env_remove<K>(&mut self, key: K) -> &mut Executor
where
K: AsRef<OsStr>,
{
match self {
Executor::Wet(c) => {
c.env_remove(key);
}
Executor::Dry(_) => (),
}
self
}
#[allow(dead_code)] #[allow(dead_code)]
/// See `std::process::Command::env` /// See `std::process::Command::env`
pub fn env<K, V>(&mut self, key: K, val: V) -> &mut Executor pub fn env<K, V>(&mut self, key: K, val: V) -> &mut Executor

View File

@@ -36,7 +36,11 @@ pub fn run_go(base_dirs: &BaseDirs, run_type: RunType) -> Result<()> {
.require()?; .require()?;
print_separator("Go"); print_separator("Go");
run_type.execute(&go).arg("get").arg("-u").arg("all").check_run() run_type
.execute(&go)
.args(&["get", "-u", "all"])
.env_remove("GO111MODLE")
.check_run()
} }
pub fn run_gem(base_dirs: &BaseDirs, run_type: RunType) -> Result<()> { pub fn run_gem(base_dirs: &BaseDirs, run_type: RunType) -> Result<()> {