Which is the effective way to trim the leading and trailing white spaces of string variable in Go?
For trimming your string, Go's "strings" package have TrimSpace(), Trim() function that trims leading and trailing spaces.
TrimSpace()
Trim()
Check the documentation for more information.