Skip to content

Instantly share code, notes, and snippets.

@ilyabrin
Created December 21, 2015 01:33
Show Gist options
  • Select an option

  • Save ilyabrin/fe46ec11b32eb37a1d71 to your computer and use it in GitHub Desktop.

Select an option

Save ilyabrin/fe46ec11b32eb37a1d71 to your computer and use it in GitHub Desktop.
Golang Reverse String
package main
import "fmt"
func main() {
fmt.Println(reverse("Golang!"))
}
func reverse(s string) (ret string) {
for _, v := range s {
defer func(r rune) { ret += string(r) }(v)
}
return
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment