Skip to content

Instantly share code, notes, and snippets.

@alaindet
Created July 6, 2024 21:23
Show Gist options
  • Save alaindet/4c65714c77e4d8134506a9bc15034ee4 to your computer and use it in GitHub Desktop.
Save alaindet/4c65714c77e4d8134506a9bc15034ee4 to your computer and use it in GitHub Desktop.
Go exercise #1
/**
* What does this script output? Watch out!
*/
package main
import "fmt"
type mystring string
func (s mystring) String() string {
return "$" + string(s)
}
func main() {
x := mystring("x")
fmt.Println("{" + x + "}")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment