Skip to content

Commit

Permalink
don't ignore go mod command errors
Browse files Browse the repository at this point in the history
Currently, errors returned by the `go mod` commands are ignored,
even though the error output is printed. This can lead to situations
where the service completes successfully, but doesn't actually do
anything, as is sometimes the case where the `vendor` folder is already
included in the code base.
  • Loading branch information
stefannica authored and jfkw committed Aug 20, 2020
1 parent 3c6ae6d commit 3bb1a37
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions go_modules
Original file line number Diff line number Diff line change
Expand Up @@ -146,12 +146,11 @@ def cmd_go_mod(cmd, dir):
output = check_output(["go", "mod", cmd], cwd=dir).decode("utf-8").strip()
if output:
log.info(output)
return True
except CalledProcessError as e:
error = e.output.decode("utf-8").strip()
if error:
log.info(error)
return False
raise


def main():
Expand Down

0 comments on commit 3bb1a37

Please sign in to comment.