package main
import "fmt"
type str string
func check[T ~string](x T) T {
return x
}
func main() {
var mytype string = "hello world"
fmt.Println(check(mytype))
}
1 - i don't understand the point of ~ it just restrict arguments types to a certain type which doesn't make any sense for me
2 - what increases the confusion is that both str and string works which makes sense but confusing