Skip to content

Commit

Permalink
Use exec to avoid forking
Browse files Browse the repository at this point in the history
  • Loading branch information
pierreprinetti committed Mar 23, 2022
1 parent bb9b378 commit 476b3c8
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions go-setversion
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,7 @@ if [ "${1:-}" == 'setversion' ]; then

# Calling `go version` here will ensure that the requested Go version
# is immediately prepared (see below).
go version
exit 0
exec go version
fi

# Fetches the configured Go version from the config file. If no match is found,
Expand Down Expand Up @@ -110,5 +109,4 @@ else
fi

# Finally, execute the actual Go binary with all the original arguments.
"$go" "$@"
exit $?
exec "$go" "$@"

0 comments on commit 476b3c8

Please sign in to comment.