diff options
author | baude <bbaude@redhat.com> | 2020-12-17 12:07:13 -0600 |
---|---|---|
committer | baude <bbaude@redhat.com> | 2020-12-21 09:21:46 -0600 |
commit | 401dcff8389e10c6fd88ad34f82daccb8f800d3f (patch) | |
tree | 2ccb5389ef46b53329911acf8d0fd5aa16a7b74f /pkg/bindings/generator/generator.go | |
parent | d6925182cdaf94225908a386d02eae8fd3e01123 (diff) | |
download | podman-401dcff8389e10c6fd88ad34f82daccb8f800d3f.tar.gz podman-401dcff8389e10c6fd88ad34f82daccb8f800d3f.tar.bz2 podman-401dcff8389e10c6fd88ad34f82daccb8f800d3f.zip |
podman v3 container bindings
convert the golang container bindings to all use options so that changes
in the future are more managable.
Signed-off-by: baude <bbaude@redhat.com>
Diffstat (limited to 'pkg/bindings/generator/generator.go')
-rw-r--r-- | pkg/bindings/generator/generator.go | 4 |
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") } |