IBM / go-sdk-core

The go-sdk-core repository contains core functionality required by Go code generated by the IBM OpenAPI SDK Generator.
Apache License 2.0
30 stars 24 forks source link

feat: add utility function to convert primitive type slices to string slices #68

Closed jorge-ibm closed 4 years ago

jorge-ibm commented 4 years ago

This PR adds a new method, ConvertSlice which converts any non-string slice to a string slice using the go marshal method, along with string manipulation.

I chose to return an empty slice if an error occurs during conversion to reduce the generated code needed to use this method, though if we feel it's best to return an error rather than an empty slice I'm not against that change. I've added test cases to hopefully capture all the realistic scenarios this method would be used in.

ref: https://github.ibm.com/arf/planning-sdk-squad/issues/1904

jorge-ibm commented 4 years ago

@padamstx - I've changed the method to return an error, along with the other changes you requested.

ibm-devx-automation commented 4 years ago

:tada: This PR is included in version 4.3.0 :tada:

The release is available on GitHub release

Your semantic-release bot :package::rocket: