Created
July 6, 2024 21:23
-
-
Save alaindet/4c65714c77e4d8134506a9bc15034ee4 to your computer and use it in GitHub Desktop.
Go exercise #1
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
/** | |
* 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