cmd/link: skip TestDWARF when cgo is disabled

While we're here, fix a Skip/Skipf error I noticed.

Fixes #19796.

Change-Id: I59b1f5b5ea727fc314acfee8445b3de0b5af1e46
Reviewed-on: https://go-review.googlesource.com/38992
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
diff --git a/src/cmd/link/dwarf_test.go b/src/cmd/link/dwarf_test.go
index 4c7e2e4..f88aecc 100644
--- a/src/cmd/link/dwarf_test.go
+++ b/src/cmd/link/dwarf_test.go
@@ -20,6 +20,7 @@
 )
 
 func TestDWARF(t *testing.T) {
+	testenv.MustHaveCGO(t)
 	testenv.MustHaveGoBuild(t)
 
 	if runtime.GOOS == "plan9" {