diff options
Diffstat (limited to 'vendor/github.com/vektah/gqlgen/codegen/import.go')
-rw-r--r-- | vendor/github.com/vektah/gqlgen/codegen/import.go | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/vendor/github.com/vektah/gqlgen/codegen/import.go b/vendor/github.com/vektah/gqlgen/codegen/import.go new file mode 100644 index 00000000..b511e8f6 --- /dev/null +++ b/vendor/github.com/vektah/gqlgen/codegen/import.go @@ -0,0 +1,29 @@ +package codegen + +import ( + "strconv" +) + +type Import struct { + Name string + Path string + + alias string +} + +type Imports struct { + imports []*Import + destDir string +} + +func (i *Import) Write() string { + return i.Alias() + " " + strconv.Quote(i.Path) +} + +func (i *Import) Alias() string { + if i.alias == "" { + panic("alias called before imports are finalized") + } + + return i.alias +} |