any is Go’s least-constraining generic type constraint: it permits every type. Use it when a function, structure, or variable should remain reusable across concrete types. section 7.1.1 section 7.6
A reusable generic function
func prettyPrint[T any](t T) { fmt.Printf("> %v", t) } accepts values such as float64 and string. Calling prettyPrint[float64](.25) supplies the type explicitly; calling prettyPrint("pockets") lets the compiler infer T. section 7.1.1
func prettyPrint[T any](t T){
fmt.Printf("> %v", t) #1
}
prettyPrint[float64](.25) #2
prettyPrint[string]("pockets")
Compare explicit type arguments for float64 and string in one compact generic-function example. section 7.1.1
The compiler generates the required concrete flavors at compilation time, while the generic implementation removes duplicated functions. Replace any with narrower constraints when the implementation needs operations such as comparison or ordering. section 7.1.1 section 7.6



