
With generics a single function can have multiple concrete instantiations, the old version of FindFileLocation supported at most one concrete instantiation per function and any number of inlined calls, this supports any number of inlined calls and concrete functions.
13 lines
134 B
Go
13 lines
134 B
Go
package main
|
|
|
|
import "fmt"
|
|
|
|
func testfn[T any](arg T) {
|
|
fmt.Println(arg)
|
|
}
|
|
|
|
func main() {
|
|
testfn[uint16](1)
|
|
testfn[float64](2.1)
|
|
}
|