MCPcopy Index your code
hub / github.com/sqlc-dev/sqlc / loadSchema

Function loadSchema

internal/endtoend/json_schema_test.go:17–31  ·  view source on GitHub ↗
(t *testing.T, path string)

Source from the content-addressed store, hash-verified

15}
16
17func loadSchema(t *testing.T, path string) *gojsonschema.Schema {
18 t.Helper()
19
20 schemaBytes, err := os.ReadFile(path)
21 if err != nil {
22 t.Fatal(err)
23 }
24
25 loader := gojsonschema.NewStringLoader(string(schemaBytes))
26 schema, err := gojsonschema.NewSchema(loader)
27 if err != nil {
28 t.Fatalf("invalid schema: %s", err)
29 }
30 return schema
31}
32
33func TestJsonSchema(t *testing.T) {
34 t.Parallel()

Callers 1

TestJsonSchemaFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected