
* proc,locspec: support setting breakpoints by func name on generic funcs Changes proc.Function to parse function names correctly when they contain instantiation lists and locspec to match generic functions. * vendor: update golang.org/x/tools The old version of golang.org/x/tools is incompatible with the new iexport format.
25 lines
345 B
Go
25 lines
345 B
Go
package main
|
|
|
|
import "fmt"
|
|
|
|
type ParamReceiver[T any] struct {
|
|
field T
|
|
}
|
|
|
|
func (r *ParamReceiver[T]) Amethod() {
|
|
fmt.Printf("%v\n", r.field)
|
|
}
|
|
|
|
func ParamFunc[T any](arg T) {
|
|
fmt.Printf("%v\n", arg)
|
|
}
|
|
|
|
func main() {
|
|
var x ParamReceiver[int]
|
|
var y ParamReceiver[float64]
|
|
x.Amethod()
|
|
y.Amethod()
|
|
ParamFunc[int](2)
|
|
ParamFunc[float32](2)
|
|
}
|