Skip to content

Instantly share code, notes, and snippets.

@DennyLoko
Created January 19, 2017 17:21
Show Gist options
  • Save DennyLoko/eb98a9532159448a3a1ad37ce80a4169 to your computer and use it in GitHub Desktop.
Save DennyLoko/eb98a9532159448a3a1ad37ce80a4169 to your computer and use it in GitHub Desktop.
go-generics test
package main
import (
"fmt"
)
type F generics
func cornuz(a, b, c, d, e F) F {
return a
}
func main() {
fmt.Println("Go cornz")
cornuz(1, "2", 3.0, int32(4), uint64(5))
cornuz(1, 2, 3, 4, 5)
}
package main
import (
"fmt"
)
type F interface{}
func cornuz(a, b, c, d, e F) F
func main() {
fmt.Println("Go cornz")
cornuz_of_int64_string_float64__(1, "2", 3.0, int32(4), uint64(5))
cornuz_of_int64_int64_int64_int64_int64(1, 2, 3, 4, 5)
}
func cornuz_of_int64_string_float64__(a int64, b string, c float64, d , e ) F {
return a
}
func cornuz_of_int64_int64_int64_int64_int64(a int64, b int64, c int64, d int64, e int64) F {
return a
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment