I am trying to concatenate an integer with an existing string by casting
and the appending using +
. But it doesn't work.
package main
import (
"fmt"
)
func main() {
a := 4
b := "The value of a is "
fmt.Println(b + string(a))
}
This prints a garbage character on go playground and nothing on the Unix terminal. What could be the reason for this? What is incorrect with this method?