cmd/macos-roots-test: fix build when CGO_ENABLED=0

Change-Id: Ia5ba6eec5350389b44bcb8c06fc31d34ec3ebde8
Reviewed-on: https://go-review.googlesource.com/c/exp/+/192321
Run-TryBot: Bryan C. Mills <bcmills@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Alexander Rakoczy <alex@golang.org>
diff --git a/cmd/macos-roots-test/root_nocgo_darwin.go b/cmd/macos-roots-test/root_nocgo_darwin.go
new file mode 100644
index 0000000..bb338a1
--- /dev/null
+++ b/cmd/macos-roots-test/root_nocgo_darwin.go
@@ -0,0 +1,16 @@
+// Copyright 2019 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// +build !cgo
+
+package main
+
+import (
+	"crypto/x509"
+	"errors"
+)
+
+func loadSystemRoots() (*x509.CertPool, error) {
+	return nil, errors.New("can't load system roots: cgo not enabled")
+}