Skip to content

hack: fragile awk pipeline used to read GOARCH in install.sh #8999

@Ankitsinghsisodya

Description

@Ankitsinghsisodya

Problem

hack/install.sh line 33 reads the Go architecture with:

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

This is fragile because:

  • It pipes through three commands instead of one
  • It depends on the exact string format of go env output (using single-quote delimiters), which is an implementation detail that can change

Proposed Fix

Use the canonical single-variable form:

KO_ARCH=$(go env GOARCH)

go env <VAR> is the documented, stable way to read one environment variable and outputs just the value with no surrounding quotes.

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

Status

Backlog

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions