Rewrite of TrimTrailing White Spaces in Go language