examples/iface: expand test

Change-Id: Ibe437b2af33ec9adcf136e51acf50bbc5f4e18b7
This commit is contained in:
Sebastien Binet 2015-08-14 13:01:21 +02:00
parent 14b9cb2dba
commit c8ce550bd3
1 changed files with 20 additions and 0 deletions

View File

@ -2,8 +2,28 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// package iface tests various aspects of interfaces.
package iface
import (
"github.com/go-python/gopy/_examples/cpkg"
)
// Iface has a single F() method
type Iface interface {
F()
}
// T implements Iface
type T struct{}
func (t *T) F() {
cpkg.Printf("t.F [CALLED]\n")
}
// CallIface calls F() on v
func CallIface(v Iface) {
cpkg.Printf("iface.CallIface...\n")
v.F()
cpkg.Printf("iface.CallIface... [DONE]\n")
}