Created
October 18, 2016 18:54
-
-
Save danielribeiro/dd0914c86121d8b32698bf5e413b43cd to your computer and use it in GitHub Desktop.
extensing_string.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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