import (
"bytes"
"fmt"
+ "internal/testenv"
"io/ioutil"
"os"
"path/filepath"
< golang.org/x/crypto/poly1305
< golang.org/x/crypto/chacha20poly1305
< golang.org/x/crypto/hkdf
- < crypto/x509/internal/macOS
+ < crypto/x509/internal/macos
< crypto/x509/pkix
< crypto/x509
< crypto/tls;
}
func TestDependencies(t *testing.T) {
- iOS := runtime.GOOS == "darwin" && runtime.GOARCH == "arm64"
- if iOS {
+ if !testenv.HasSrc() {
// Tests run in a limited file system and we do not
// provide access to every source file.
t.Skipf("skipping on %s/%s, missing full GOROOT", runtime.GOOS, runtime.GOARCH)
}
}
}
+
+// TestStdlibLowercase tests that all standard library package names are
+// lowercase. See Issue 40065.
+func TestStdlibLowercase(t *testing.T) {
+ if !testenv.HasSrc() {
+ t.Skipf("skipping on %s/%s, missing full GOROOT", runtime.GOOS, runtime.GOARCH)
+ }
+
+ ctxt := Default
+ all, err := listStdPkgs(ctxt.GOROOT)
+ if err != nil {
+ t.Fatal(err)
+ }
+
+ for _, pkgname := range all {
+ if strings.ToLower(pkgname) != pkgname {
+ t.Errorf("package %q should not use upper-case path", pkgname)
+ }
+ }
+}
// syscallNoErr is used in crypto/x509 to call into Security.framework and CF.
-//go:linkname crypto_x509_syscall crypto/x509/internal/macOS.syscall
+//go:linkname crypto_x509_syscall crypto/x509/internal/macos.syscall
//go:nosplit
//go:cgo_unsafe_args
func crypto_x509_syscall(fn, a1, a2, a3, a4, a5, a6 uintptr) (r1 uintptr) {