INNER CODE UNIT · Go

driverSee

xo/usql · driverdoc_test.go:105

func driverSee(t *testing.T, tag string) (string, bool) {
	t.Helper()
	name := filepath.Join("drivers", tag, tag+".go")
	f, err := parser.ParseFile(token.NewFileSet(), name, nil, parser.ParseComments)
	if err != nil {
		t.Fatalf("parsing %s: %v", name, err)
	}
	m := seeRE.FindStringSubmatch(f.Doc.Text())
	if m == nil {
		return "", false
	}
	return strings.TrimSpace(m[1]), true
}

// TestRegistryIsKeyedByScheme checks that usql's driver registry is keyed by
// dburl's scheme name, which is URL.SchemeName, and not by the name that
// database/sql opens, which is URL.Driver.
//

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…