From 983aa8195c55e82b347a9fae2aafb9f764cb6291 Mon Sep 17 00:00:00 2001 From: Sebastien Binet Date: Fri, 7 Aug 2015 09:23:09 +0200 Subject: [PATCH] gopy: add focused examples (named,iface,funcs) Change-Id: I635f215149888e356621992504620e283de5b37c --- _examples/empty/empty.go | 5 +++++ _examples/funcs/funcs.go | 15 +++++++++++++++ _examples/iface/iface.go | 9 +++++++++ _examples/named/named.go | 14 ++++++++++++++ 4 files changed, 43 insertions(+) create mode 100644 _examples/empty/empty.go create mode 100644 _examples/funcs/funcs.go create mode 100644 _examples/iface/iface.go create mode 100644 _examples/named/named.go diff --git a/_examples/empty/empty.go b/_examples/empty/empty.go new file mode 100644 index 0000000..10763a2 --- /dev/null +++ b/_examples/empty/empty.go @@ -0,0 +1,5 @@ +// Copyright 2015 The go-python Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package empty diff --git a/_examples/funcs/funcs.go b/_examples/funcs/funcs.go new file mode 100644 index 0000000..2b555a9 --- /dev/null +++ b/_examples/funcs/funcs.go @@ -0,0 +1,15 @@ +// Copyright 2015 The go-python Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package funcs + +type Func func() + +type S1 struct { + F Func +} + +type S2 struct { + F func() +} diff --git a/_examples/iface/iface.go b/_examples/iface/iface.go new file mode 100644 index 0000000..60c9d19 --- /dev/null +++ b/_examples/iface/iface.go @@ -0,0 +1,9 @@ +// Copyright 2015 The go-python Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package iface + +type Iface interface { + F() +} diff --git a/_examples/named/named.go b/_examples/named/named.go new file mode 100644 index 0000000..b5f69f7 --- /dev/null +++ b/_examples/named/named.go @@ -0,0 +1,14 @@ +// Copyright 2015 The go-python Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package named + +type Float float32 + +func (f Float) Value() float32 { return float32(f) } + +type X float32 +type XX X +type XXX XX +type XXXX XXX