"ToStringSlice" does not support slice of ints?
Open
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 4k
- Forks
- 337
- Avg merge
- 15m
- Merged PRs (30d)
- 1
Description
I was hoping that ToStringSlice would support turning a slice of ints into a slice of strings. Am I wrong in that assumption?
The following fails:
nums := []int{1,2,3,4,5}
out := cast.ToStringSlice(nums)
// expected: []string{"1","2","3","4","5"}
// actual: []
If I use ToStringSliceE I get the error:
unable to cast []int{1, 2, 3, 4, 5} of type []int to []string
Is there a cast method that does what I want that I'm not aware of?
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the cast.ToStringSlice entry point and reproduce the []int example from the issue. Check how slice inputs are handled and verify that the completed behavior returns []string{"1","2","3","4","5"}, while preserving the existing error-reporting behavior for unsupported inputs.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100