Created
December 24, 2018 08:23
-
-
Save zeddee/04e765afa27f9e5f199907f3b4474724 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 ( | |
"log" | |
"reflect" | |
) | |
type dummy interface{} | |
func main() { | |
x := readtodummy("hello") | |
y := x.(string) | |
log.Println(x == y) | |
log.Println(reflect.DeepEqual(x, y)) | |
log.Println(x, y) | |
} | |
func readtodummy(s dummy) (d dummy) { | |
d = s | |
return d | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment