I have a function that receives a list of hostnames , line by line, in an int32 slice format. This is the function:
func HandlePipeList(targetsList []int32) {
//Print output item by item
for i := 0; i < len(targetsList); i++ {
fmt.Printf("%c", targetsList[i])
}
}
Since I'm converting it to %c
with fmt, it works and prints the hostnames correctly.
My problem arises when I try to pass targetsList as a string to another function. How can I make the same convertion for targetsList so that the lines could be passed as string? (strconv.Itoa
didn't work here).