aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/github.com/shurcooL/githubv4/gen.go
diff options
context:
space:
mode:
authorAmine Hilaly <hilalyamine@gmail.com>2019-06-14 20:27:17 +0200
committerAmine Hilaly <hilalyamine@gmail.com>2019-06-24 21:21:15 +0200
commit946c936c5c447fd1ef36fca0a17c6e6ec40c8054 (patch)
tree248f4c4dcb9d1e64283642c744017ee4e1c663ae /vendor/github.com/shurcooL/githubv4/gen.go
parentfbb0e836d3d23e5a3e47029c92426090e21615f7 (diff)
downloadgit-bug-946c936c5c447fd1ef36fca0a17c6e6ec40c8054.tar.gz
[vendor] update dependencies: github.com/shurcooL/githubv4
[bridge/github] graphql: Add more mutations structs
Diffstat (limited to 'vendor/github.com/shurcooL/githubv4/gen.go')
-rw-r--r--vendor/github.com/shurcooL/githubv4/gen.go13
1 files changed, 7 insertions, 6 deletions
diff --git a/vendor/github.com/shurcooL/githubv4/gen.go b/vendor/github.com/shurcooL/githubv4/gen.go
index 43ad1e35..628ce57b 100644
--- a/vendor/github.com/shurcooL/githubv4/gen.go
+++ b/vendor/github.com/shurcooL/githubv4/gen.go
@@ -86,12 +86,12 @@ package githubv4
{{- define "enum" -}}
-// {{.name}} {{.description | endSentence}}
+// {{.name}} {{.description | clean | endSentence}}
type {{.name}} string
-// {{.description | fullSentence}}
+// {{.description | clean | fullSentence}}
const ({{range .enumValues}}
- {{$.name}}{{.name | enumIdentifier}} {{$.name}} = {{.name | quote}} // {{.description | fullSentence}}{{end}}
+ {{$.name}}{{.name | enumIdentifier}} {{$.name}} = {{.name | quote}} // {{.description | clean | fullSentence}}{{end}}
)
{{- end -}}
`),
@@ -110,12 +110,12 @@ type Input interface{}
{{- define "inputObject" -}}
-// {{.name}} {{.description | endSentence}}
+// {{.name}} {{.description | clean | endSentence}}
type {{.name}} struct {{"{"}}{{range .inputFields}}{{if eq .type.kind "NON_NULL"}}
- // {{.description | fullSentence}} (Required.)
+ // {{.description | clean | fullSentence}} (Required.)
{{.name | identifier}} {{.type | type}} ` + "`" + `json:"{{.name}}"` + "`" + `{{end}}{{end}}
{{range .inputFields}}{{if ne .type.kind "NON_NULL"}}
- // {{.description | fullSentence}} (Optional.)
+ // {{.description | clean | fullSentence}} (Optional.)
{{.name | identifier}} {{.type | type}} ` + "`" + `json:"{{.name}},omitempty"` + "`" + `{{end}}{{end}}
}
{{- end -}}
@@ -167,6 +167,7 @@ func t(text string) *template.Template {
"identifier": func(name string) string { return ident.ParseLowerCamelCase(name).ToMixedCaps() },
"enumIdentifier": func(name string) string { return ident.ParseScreamingSnakeCase(name).ToMixedCaps() },
"type": typeString,
+ "clean": func(s string) string { return strings.Join(strings.Fields(s), " ") },
"endSentence": func(s string) string {
s = strings.ToLower(s[0:1]) + s[1:]
switch {