diff --git a/templates/gitlab-ci-golang.yml b/templates/gitlab-ci-golang.yml
index 336d505753e5ee4605cdbb2ddb53f63f80c3ed82..fc69543706056afadc614a70101e51ec6986354d 100644
--- a/templates/gitlab-ci-golang.yml
+++ b/templates/gitlab-ci-golang.yml
@@ -514,7 +514,7 @@ go-build:
       - $GO_PROJECT_DIR/bin/
   rules:
     # if $GO_TEST_IMAGE set
-    - if: '$GO_TEST_IMAGE'
+    - if: '$GO_TEST_IMAGE != ""'
 
 go-test:
   extends: .go-base