mirror of
https://github.com/golang/go
synced 2024-09-05 07:54:46 +00:00
17 lines
196 B
Go
17 lines
196 B
Go
![]() |
package a
|
||
|
|
||
|
type Builder[T any] struct{}
|
||
|
|
||
|
func (r Builder[T]) New() T {
|
||
|
var v T
|
||
|
return v
|
||
|
}
|
||
|
|
||
|
func (r Builder[T]) New2() T {
|
||
|
return r.New()
|
||
|
}
|
||
|
|
||
|
func BuildInt() int {
|
||
|
return Builder[int]{}.New()
|
||
|
}
|