Skip to content

Instantly share code, notes, and snippets.

@kolotaev
Last active April 27, 2021 19:22
Show Gist options
  • Save kolotaev/d6af86c41d0de0e3c2bd02dededa3f02 to your computer and use it in GitHub Desktop.
Save kolotaev/d6af86c41d0de0e3c2bd02dededa3f02 to your computer and use it in GitHub Desktop.
package main
import (
"fmt"
)
type String string
func (f String) Dasherize() String {
return "---" + f + "---"
}
func Me(me String) String {
return me.Dasherize()
}
func Print(val String) {
fmt.Printf("%s", val + "can be concatenated like a string")
}
func main() {
me := Me("Kitty")
Print(me)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment