improve proxy
This commit is contained in:
35
exp/funint/main.go
Normal file
35
exp/funint/main.go
Normal file
@ -0,0 +1,35 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"net"
|
||||
)
|
||||
|
||||
type Foo interface {
|
||||
Bar()
|
||||
}
|
||||
|
||||
func bar() {
|
||||
fmt.Println("bar")
|
||||
}
|
||||
|
||||
func run(f Foo) {
|
||||
f.Bar()
|
||||
}
|
||||
|
||||
type t struct {
|
||||
Bar func()
|
||||
}
|
||||
|
||||
type t2 struct {
|
||||
}
|
||||
|
||||
func (t t2) Bar() {
|
||||
bar()
|
||||
}
|
||||
|
||||
func main() {
|
||||
run(t2{})
|
||||
var d net.Dialer
|
||||
d.Cancel
|
||||
}
|
Reference in New Issue
Block a user