Remove characters from the edges of strings:
s := " Hello World "
fmt.Println(strings.TrimSpace(s)) // "Hello World"
fmt.Println(strings.Trim(s, " ")) // "Hello World"
fmt.Println(strings.TrimPrefix(s, " ")) // "Hello World "
fmt.Println(strings.TrimSuffix(s, " ")) // " Hello World"
TrimSpace removes all whitespace. Trim removes specified characters from both ends. TrimPrefix and TrimSuffix remove from one end only.