Can use if ! go install -tags "$tags" "github.com/openshift/geard/${artifact}"; then .... else ... fi to avoid using set +e and checking $?