|
| 1 | +# Copyright 2018 The go-python Authors. All rights reserved. |
| 2 | +# Use of this source code is governed by a BSD-style |
| 3 | +# license that can be found in the LICENSE file. |
| 4 | +import multireturn, go |
| 5 | + |
| 6 | +############### No Return ############## |
| 7 | +noResult = multireturn.NoReturnFunc() |
| 8 | +print("No Return %r" % noResult) |
| 9 | + |
| 10 | +############### Single WithoutError Return ############## |
| 11 | +oneResult = multireturn.SingleWithoutErrorFunc() |
| 12 | +print("Single WithoutError Return %r" % oneResult) |
| 13 | + |
| 14 | +############### Single WithError Return ############## |
| 15 | +errorFalseResult = multireturn.SingleWithErrorFunc(False) |
| 16 | +print("Single WithError(False) Return %r" % errorFalseResult) |
| 17 | + |
| 18 | +errorTrueResult = multireturn.SingleWithErrorFunc(True) |
| 19 | +print("Single WithError(True) Return %r" % errorTrueResult) |
| 20 | + |
| 21 | +############### Double WithoutError Return ############## |
| 22 | +twoResults = multireturn.DoubleWithoutErrorFunc() |
| 23 | +print("Double WithoutError Return %r" % twoResults) |
| 24 | + |
| 25 | +############### Double WithError Return ############## |
| 26 | +(value400, errorTrueResult) = multireturn.DoubleeWithErrorFunc(True) |
| 27 | +print("Double WithError(True) Return (%r, %r)" % (value400, errorTrueResult)) |
| 28 | + |
| 29 | +(value500, errorFalseResult) = multireturn.DoubleWithErrorFunc(False) |
| 30 | +print("Double WithError(False) Return (%r, %r)" % (value500, errorFalseResult)) |
| 31 | + |
| 32 | +############### Triple Without Error Return ############## |
| 33 | +threeResults = multireturn.TripleWithoutErrorFunc() |
| 34 | +print("Triple WithoutError Return %r" % threeResult) |
| 35 | + |
| 36 | +############### Triple With Error Return ############## |
| 37 | +(value900, value1000, errorTrueResult) = multireturn.TripleWithErrorFunc(True) |
| 38 | +print("Triple WithError(True) Return (%r, %r, %r)" % (value900, value1000, errorFalseResult)) |
| 39 | + |
| 40 | +(value1100, value1200, errorFalseResult) = multireturn.TripleWithErrorFunc(False) |
| 41 | +print("Triple WithError(False) Return (%r, %r, %r)" % (value1100, value1200, errorFalseResult)) |
| 42 | + |
| 43 | +############### Triple Struct Return With Error ############## |
| 44 | +(ptr1300, struct1400, errorTrueResult) = multireturn.TripleWithStructWithErrorFunc(True) |
| 45 | +print("Triple WithError(True) Return (%r, %r, %r)" % (ptr1300.P, struct1400.P, errorFalseResult)) |
| 46 | + |
| 47 | +(value1500, value1600, errorFalseResult) = multireturn.TripleWithStructWithErrorFunc(False) |
| 48 | +print("Triple WithError(False) Return (%r, %r, %r)" % (value1500.P, value1600.P, errorFalseResult)) |
| 49 | + |
| 50 | +############### Triple Interface Return Without Error ############## |
| 51 | +(interface1700, struct1800, ptr1900) = multireturn.TripleWithInterfaceWithoutErrorFunc() |
| 52 | +print("Triple WithError(True) Return (%r, %r, %r)" % (interface1700.P, struct1800.P, ptr1900)) |
0 commit comments