Skip to content

Instantly share code, notes, and snippets.

@damithadayananda
Created April 14, 2022 07:23
Show Gist options
  • Save damithadayananda/06e5e1b94eab5d8ea999651dd3bb9d64 to your computer and use it in GitHub Desktop.
Save damithadayananda/06e5e1b94eab5d8ea999651dd3bb9d64 to your computer and use it in GitHub Desktop.
import "golang.org/x/exp/constraints"
type Animal[T constraints.Ordered, K constraints.Float] struct {
Height K
Metadata []T
}
func TypeType() Animal[string,float32]{
A :=Animal[string,float32]{}
A.Height = 67.89
A.Metadata = []string{
"x",
"y",
}
return A
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment