Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
GitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
Convert nano time to string return garbage? #39089
What version of Go are you using (
string(x) doesn't do what you think it does when x is an integer. It interprets x as a unicode code point and creates a string with the UTF-8 encoding of said code point, if possible. For your particular case, it isn't possible, so you get an encoding of unicode.ReplacementChar instead: https://play.golang.org/p/qLfoV6dj_AK
To format an integer into a string, use the fmt or strconv package.