I have a local int type, Duration, type Duration int
and I’ve added a String method to it (wrapped?, I’m not sure the terminology):
func (d Duration) String() string {
num := strconv.Itoa(int(d))
if d == 1 {
return num + " second"
} else {
return num + " seconds"
}
}
This works as expected when passing a Duration into a print function:
fmt.Println("season: ", d)
but when I add it to a list of strings, I end up with the replacement string character
strings := []string
strings[i] = string(s)
�
I’m displaying the characters in a fyne GUI application. Maybe I need to tell the app which character encoding?