diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2020-12-21 15:00:22 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-21 15:00:22 -0500 |
commit | 182646b01a4544902c9fdf9326889a0ced7d9a8e (patch) | |
tree | d37e89ca4c27877098a4136910db68158e71d855 /pkg/bindings/generator | |
parent | 076f77b964329c830664b4d6fa3234f608f07591 (diff) | |
parent | 401dcff8389e10c6fd88ad34f82daccb8f800d3f (diff) | |
download | podman-182646b01a4544902c9fdf9326889a0ced7d9a8e.tar.gz podman-182646b01a4544902c9fdf9326889a0ced7d9a8e.tar.bz2 podman-182646b01a4544902c9fdf9326889a0ced7d9a8e.zip |
Merge pull request #8775 from baude/bindings3cons
podman v3 container bindings
Diffstat (limited to 'pkg/bindings/generator')
-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") } |