mirror of
https://github.com/aptly-dev/aptly.git
synced 2026-05-07 22:20:24 +00:00
Update Go AWS SDK to the latest version
This commit is contained in:
committed by
Andrey Smirnov
parent
d08be990ef
commit
94a72b23ff
+7
-6
@@ -54,14 +54,12 @@ var exampleCustomizations = map[string]template.FuncMap{}
|
||||
|
||||
var exampleTmpls = template.Must(template.New("example").Funcs(exampleFuncMap).Parse(`
|
||||
{{ generateTypes . }}
|
||||
{{ commentify (wrap .Title 80 false) }}
|
||||
{{ commentify (wrap .Title 80) }}
|
||||
//
|
||||
{{ commentify (wrap .Description 80 false) }}
|
||||
{{ commentify (wrap .Description 80) }}
|
||||
func Example{{ .API.StructName }}_{{ .MethodName }}() {
|
||||
svc := {{ .API.PackageName }}.New(session.New())
|
||||
input := &{{ .Operation.InputRef.Shape.GoTypeWithPkgNameElem }} {
|
||||
{{ generateExampleInput . -}}
|
||||
}
|
||||
input := {{ generateExampleInput . }}
|
||||
|
||||
result, err := svc.{{ .OperationName }}(input)
|
||||
if err != nil {
|
||||
@@ -130,7 +128,10 @@ func (ex Example) GoCode() string {
|
||||
|
||||
func generateExampleInput(ex Example) string {
|
||||
if ex.Operation.HasInput() {
|
||||
return ex.Builder.BuildShape(&ex.Operation.InputRef, ex.Input, false)
|
||||
return fmt.Sprintf("&%s{\n%s\n}",
|
||||
ex.Builder.GoType(&ex.Operation.InputRef, true),
|
||||
ex.Builder.BuildShape(&ex.Operation.InputRef, ex.Input, false),
|
||||
)
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user