diff --git a/codegen/config/config.go b/codegen/config/config.go index 4d642c6140a..1139a66ec0b 100644 --- a/codegen/config/config.go +++ b/codegen/config/config.go @@ -81,7 +81,10 @@ func LoadConfig(filename string) (*Config, error) { // make sure paths match files // ?.*\. - fileRegex := regexp.MustCompile(pathParts[0] + "?.*" + strings.Replace(strings.Replace(pathParts[1], ".", "\\.", -1), "*", ".+", -1)) + fileRegex := regexp.MustCompile( + pathParts[0] + + "?.*" + + strings.Replace(strings.Replace(pathParts[1], ".", "\\.", -1), "*", ".+", -1)) if fileRegex.MatchString(path) { matches = append(matches, path) } diff --git a/codegen/config/config_test.go b/codegen/config/config_test.go index 1a22c3fda98..e84f940f9f5 100644 --- a/codegen/config/config_test.go +++ b/codegen/config/config_test.go @@ -1,7 +1,6 @@ package config import ( - "fmt" "os" "path/filepath" "testing" @@ -28,8 +27,8 @@ func TestLoadConfig(t *testing.T) { t.Run("globbed filenames", func(t *testing.T) { c, err := LoadConfig("testdata/cfg/glob.yml") - require.NoError(t, err, "") - fmt.Printf("%+v\n", c) + require.NoError(t, err) + require.Equal(t, c.SchemaFilename[0], "testdata/cfg/glob/bar/bar with spaces.graphql") require.Equal(t, c.SchemaFilename[1], "testdata/cfg/glob/foo/foo.graphql") })