Skip to content

Instantly share code, notes, and snippets.

@kenjiskywalker
Created October 8, 2013 15:34
Show Gist options
  • Select an option

  • Save kenjiskywalker/6886587 to your computer and use it in GitHub Desktop.

Select an option

Save kenjiskywalker/6886587 to your computer and use it in GitHub Desktop.
package main
import (
"fmt"
"strings"
)
func main() {
foo := "hooo\n"
bar := "bar\n"
fmt.Printf("foo is %s bar is %s", foo, bar)
// foo is hooo
// bar is bar
foo = strings.TrimRight(foo, "\n")
bar = strings.TrimRight(bar, "\n")
fmt.Printf("foo is %s bar is %s", foo, bar)
// foo is hooo bar is bar
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment