Skip to content

Instantly share code, notes, and snippets.

@danielribeiro
Created October 18, 2016 18:54
Show Gist options
  • Save danielribeiro/dd0914c86121d8b32698bf5e413b43cd to your computer and use it in GitHub Desktop.
Save danielribeiro/dd0914c86121d8b32698bf5e413b43cd to your computer and use it in GitHub Desktop.
extensing_string.go
package main
import (
"fmt"
)
type MyString string
func (s MyString) plusa() MyString {
return s + "a"
}
func main() {
s := MyString("text")
fmt.Println(s)
fmt.Println(s.plusa())
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment