Golang has support for generic since 1.18. To see a simple example of how we can use it, check out the following codes:- We declare generics right next to the function name declaration using [T number] as shown below:- package main import ( "fmt" ) type Number interface { int | float32 | float64 } func PrintNumbers [ T Number ]( t [] T ) { for _ , v := range t { fmt . Println ( v ) } } func PrintValue [ T any ]( t [] T ) { for _ , v := range t { fmt . Println ( v ) } } func main () { PrintValue ([] int { 1 , 2 , 3 , 4 }) PrintValue ([] string { "1" , "2" , "3" }) PrintNumbers ([] int { 1 , 2 , 3 , 4 }) // constraint are not satisfied here //PrintNumbers([]string{"1", "2", "3"}) } Then we have generics for struct - as you can see here type Bo...