diff --git a/generate/generate_test.go b/generate/generate_test.go index e771c561..93e0f19c 100644 --- a/generate/generate_test.go +++ b/generate/generate_test.go @@ -6,6 +6,7 @@ import ( "os" "os/exec" "path/filepath" + "runtime" "strings" "testing" @@ -62,6 +63,13 @@ func TestGenerate(t *testing.T) { t.Fatal(err) } + if strings.HasPrefix(runtime.Version(), "go1.13") && + sourceFilename == "InterfaceNesting.graphql" { + // gofmt on 1.13 formats this slightly differently. + // TODO(benkraft): Vendor in a specific version of gofmt, + // to use for all Go versions. (Maybe only for tests.) + } + for filename, content := range generated { t.Run(filename, func(t *testing.T) { testutil.Cupaloy.SnapshotT(t, string(content))