C-like:
package main
import (
"fmt"
"strings"
)
func main() {
fmt.Println(ReverseWords("The greatest victory is that which requires no battle"))
fmt.Println(ReverseWords("hello world!"))
}
func ReverseWords(str string) string {
temp := ""
newStr := strings.Split(str, " ")
for i := len(newStr) - 1; i >= 0; i-- {
temp += newStr[i] + " "
}
return strings.TrimSpace(temp)
}