Skip to content

Instantly share code, notes, and snippets.

@flaviocopes
Last active November 15, 2021 09:34
Show Gist options
  • Save flaviocopes/6f9e4c82c27cf0738047c857e1c8b2c8 to your computer and use it in GitHub Desktop.
Save flaviocopes/6f9e4c82c27cf0738047c857e1c8b2c8 to your computer and use it in GitHub Desktop.
Go: check if a string ends with a substring #golang
package main
import (
"strings"
)
func main() {
strings.HasSuffix("foobar", "bar") // true
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment