summaryrefslogtreecommitdiff
path: root/pkg/bindings/generator/generator.go
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/bindings/generator/generator.go')
-rw-r--r--pkg/bindings/generator/generator.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/pkg/bindings/generator/generator.go b/pkg/bindings/generator/generator.go
index 1fd428451..8c79aebae 100644
--- a/pkg/bindings/generator/generator.go
+++ b/pkg/bindings/generator/generator.go
@@ -69,10 +69,10 @@ func (o *{{.StructName}}) ToParams() (url.Values, error) {
params.Set(fieldName, strconv.FormatUint(f.Uint(), 10))
case reflect.Slice:
typ := reflect.TypeOf(f.Interface()).Elem()
- slice := reflect.MakeSlice(reflect.SliceOf(typ), f.Len(), f.Cap())
switch typ.Kind() {
case reflect.String:
- s, ok := slice.Interface().([]string)
+ sl := f.Slice(0, f.Len())
+ s, ok := sl.Interface().([]string)
if !ok {
return nil, errors.New("failed to convert to string slice")
}