Skip to content

Commit 32bc524

Browse files
hack: replace fragile awk pipeline with 'go env GOARCH' in install.sh (#9000)
hack: use 'go env GOARCH' instead of fragile awk pipeline in install.sh The previous 'go env | grep GOARCH | awk -F\'' pipeline is fragile: it depends on the specific output format of 'go env' which can vary. 'go env GOARCH' is the canonical, documented way to read a single Go environment variable and is simpler and more reliable.
1 parent b3edbad commit 32bc524

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

hack/install.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ fi
2929
export SCALE_CHAOSDUCK_TO_ZERO=1
3030
export REPLICAS=1
3131

32-
KO_ARCH=$(go env | grep GOARCH | awk -F\' '{print $2}')
32+
KO_ARCH=$(go env GOARCH)
3333

3434
export KO_FLAGS=${KO_FLAGS:-"--platform=linux/$KO_ARCH"}
3535

0 commit comments

Comments
 (0)