How do I convert into to its ASCII?
In java it’s
System.out.println((char)(49)); //gives 1
a := '42' fmt.Println(rune(a))
more than one character in rune literal
The reason you’re getting this error is in this variable:
a := '42'
A byte literal may only contain one character, use this instead;
a := byte(42)
string(a) to get the expected results, like boo said.
Answered By – mono
Answer Checked By – Gilberto Lyons (GoLangFix Admin)