From 966d0a8b85be81637c148713ef40c1a4194409ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Tue, 17 May 2022 23:32:38 +0300 Subject: [PATCH] style(bash-v2): use ${foo-} rather than ${foo:-} in emptiness check The result of the expansion is null no matter if the variable is unset or null in both cases; the former form is arguably easier on the eye. --- bash_completionsV2.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bash_completionsV2.go b/bash_completionsV2.go index 70c0da51..87a90667 100644 --- a/bash_completionsV2.go +++ b/bash_completionsV2.go @@ -24,7 +24,7 @@ func genBashComp(buf io.StringWriter, name string, includeDesc bool) { __%[1]s_debug() { - if [[ -n ${BASH_COMP_DEBUG_FILE:-} ]]; then + if [[ -n ${BASH_COMP_DEBUG_FILE-} ]]; then echo "$*" >> "${BASH_COMP_DEBUG_FILE}" fi }