Skip to content

Instantly share code, notes, and snippets.

@zeddee
Created December 24, 2018 08:23
Show Gist options
  • Save zeddee/04e765afa27f9e5f199907f3b4474724 to your computer and use it in GitHub Desktop.
Save zeddee/04e765afa27f9e5f199907f3b4474724 to your computer and use it in GitHub Desktop.
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