Support package-names with dashes in them (#232)
Support package-names with dashes in them We were smart about aliasing if you have name-collisions, but not if your package name is something that's not a valid identifier, like `"path/to/my-package"`, which Go for better or worse allows. Now we remove all the invalid characters (in practice mainly dashes, dots, and leading digits). Fixes #231. Test plan: make check
This commit is contained in:
@@ -171,6 +171,10 @@ func TestGenerateWithConfig(t *testing.T) {
|
||||
Generated: "generated.go",
|
||||
ContextType: "github.com/Khan/genqlient/internal/testutil.MyContext",
|
||||
}},
|
||||
{"CustomContextWithAlias", "", nil, &Config{
|
||||
Generated: "generated.go",
|
||||
ContextType: "github.com/Khan/genqlient/internal/testutil/junk---fun.name.MyContext",
|
||||
}},
|
||||
{"StructReferences", "", nil, &Config{
|
||||
StructReferences: true,
|
||||
Generated: "generated-structrefs.go",
|
||||
|
||||
Reference in New Issue
Block a user