Skip to content

Instantly share code, notes, and snippets.

@podhmo
Created September 21, 2018 13:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save podhmo/6f944e3d1e27af52cad22a98adf20c99 to your computer and use it in GitHub Desktop.
Save podhmo/6f944e3d1e27af52cad22a98adf20c99 to your computer and use it in GitHub Desktop.
package main
import (
"fmt"
)
type I interface {
F()
G()
}
type fake struct {
I
}
func (f *fake) F() {
fmt.Println("f")
}
func use(i I) {
i.F()
}
func main() {
fake := &fake{}
use(fake)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment