mirror of
				https://github.com/optim-enterprises-bv/kubernetes.git
				synced 2025-11-03 19:58:17 +00:00 
			
		
		
		
	Fix shellcheck in hack/lib/golang.sh
This commit is contained in:
		@@ -27,7 +27,6 @@
 | 
				
			|||||||
./hack/cherry_pick_pull.sh
 | 
					./hack/cherry_pick_pull.sh
 | 
				
			||||||
./hack/ginkgo-e2e.sh
 | 
					./hack/ginkgo-e2e.sh
 | 
				
			||||||
./hack/grab-profiles.sh
 | 
					./hack/grab-profiles.sh
 | 
				
			||||||
./hack/lib/golang.sh
 | 
					 | 
				
			||||||
./hack/lib/init.sh
 | 
					./hack/lib/init.sh
 | 
				
			||||||
./hack/lib/swagger.sh
 | 
					./hack/lib/swagger.sh
 | 
				
			||||||
./hack/lib/test.sh
 | 
					./hack/lib/test.sh
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -372,7 +372,7 @@ EOF
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
# Ensure the go tool exists and is a viable version.
 | 
					# Ensure the go tool exists and is a viable version.
 | 
				
			||||||
kube::golang::verify_go_version() {
 | 
					kube::golang::verify_go_version() {
 | 
				
			||||||
  if [[ -z "$(which go)" ]]; then
 | 
					  if [[ -z "$(command -v go)" ]]; then
 | 
				
			||||||
    kube::log::usage_from_stdin <<EOF
 | 
					    kube::log::usage_from_stdin <<EOF
 | 
				
			||||||
Can't find 'go' in PATH, please fix and retry.
 | 
					Can't find 'go' in PATH, please fix and retry.
 | 
				
			||||||
See http://golang.org/doc/install for installation instructions.
 | 
					See http://golang.org/doc/install for installation instructions.
 | 
				
			||||||
@@ -693,6 +693,10 @@ kube::golang::build_binaries() {
 | 
				
			|||||||
    host_platform=$(kube::golang::host_platform)
 | 
					    host_platform=$(kube::golang::host_platform)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    local goflags goldflags goasmflags gogcflags
 | 
					    local goflags goldflags goasmflags gogcflags
 | 
				
			||||||
 | 
					    # If GOLDFLAGS is unset, then set it to the a default of "-s -w".
 | 
				
			||||||
 | 
					    # Disable SC2153 for this, as it will throw a warning that the local
 | 
				
			||||||
 | 
					    # variable goldflags will exist, and it suggest changing it to this.
 | 
				
			||||||
 | 
					    # shellcheck disable=SC2153
 | 
				
			||||||
    goldflags="${GOLDFLAGS=-s -w} $(kube::version::ldflags)"
 | 
					    goldflags="${GOLDFLAGS=-s -w} $(kube::version::ldflags)"
 | 
				
			||||||
    goasmflags="-trimpath=${KUBE_ROOT}"
 | 
					    goasmflags="-trimpath=${KUBE_ROOT}"
 | 
				
			||||||
    gogcflags="${GOGCFLAGS:-} -trimpath=${KUBE_ROOT}"
 | 
					    gogcflags="${GOGCFLAGS:-} -trimpath=${KUBE_ROOT}"
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user