From c8ce550bd3fa5ef34e9d9f6d1b0f68da3d480fec Mon Sep 17 00:00:00 2001 From: Sebastien Binet Date: Fri, 14 Aug 2015 13:01:21 +0200 Subject: [PATCH] examples/iface: expand test Change-Id: Ibe437b2af33ec9adcf136e51acf50bbc5f4e18b7 --- _examples/iface/iface.go | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/_examples/iface/iface.go b/_examples/iface/iface.go index 60c9d19..1fadb26 100644 --- a/_examples/iface/iface.go +++ b/_examples/iface/iface.go @@ -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") +}