content/static: remove link to go.mod when file does not exist

Fixes golang/go#44837

Change-Id: Ia9f5b472a88bc43bfa326a11277681d46bf3a241
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/309391
Trust: Jamal Carvalho <jamal@golang.org>
Run-TryBot: Jamal Carvalho <jamal@golang.org>
TryBot-Result: kokoro <noreply+kokoro@google.com>
Reviewed-by: Julie Qiu <julie@golang.org>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
diff --git a/content/static/html/helpers/_unit_meta.tmpl b/content/static/html/helpers/_unit_meta.tmpl
index ebc0dde..33a6684 100644
--- a/content/static/html/helpers/_unit_meta.tmpl
+++ b/content/static/html/helpers/_unit_meta.tmpl
@@ -68,7 +68,7 @@
   <ul>
     <li>
       {{template "unit_meta_details_check" .Unit.HasGoMod}}
-      Valid <a href="{{.Details.ModFileURL}}" target="_blank">go.mod</a> file
+      Valid {{if .Unit.HasGoMod}}<a href="{{.Details.ModFileURL}}" target="_blank">{{end}}go.mod{{if .Unit.HasGoMod}}</a>{{end}} file
       {{template "unit_meta_details_toggletip" "The Go module system was introduced in Go 1.11 and is the official dependency management solution for Go."}}
     </li>
     <li>