| 1 |
// Copyright 2025 The Go 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 |
|
| 5 |
package main |
| 6 |
|
| 7 |
import "C" |
| 8 |
|
| 9 |
//export ReturnEmpty |
| 10 |
func ReturnEmpty() { |
| 11 |
return |
| 12 |
} |
| 13 |
|
| 14 |
//export ReturnOnlyUint8 |
| 15 |
func ReturnOnlyUint8() (uint8, uint8, uint8) { |
| 16 |
return 1, 2, 3 |
| 17 |
} |
| 18 |
|
| 19 |
//export ReturnOnlyUint16 |
| 20 |
func ReturnOnlyUint16() (uint16, uint16, uint16) { |
| 21 |
return 1, 2, 3 |
| 22 |
} |
| 23 |
|
| 24 |
//export ReturnOnlyUint32 |
| 25 |
func ReturnOnlyUint32() (uint32, uint32, uint32) { |
| 26 |
return 1, 2, 3 |
| 27 |
} |
| 28 |
|
| 29 |
//export ReturnOnlyUint64 |
| 30 |
func ReturnOnlyUint64() (uint64, uint64, uint64) { |
| 31 |
return 1, 2, 3 |
| 32 |
} |
| 33 |
|
| 34 |
//export ReturnOnlyInt |
| 35 |
func ReturnOnlyInt() (int, int, int) { |
| 36 |
return 1, 2, 3 |
| 37 |
} |
| 38 |
|
| 39 |
//export ReturnOnlyPtr |
| 40 |
func ReturnOnlyPtr() (*int, *int, *int) { |
| 41 |
a, b, c := 1, 2, 3 |
| 42 |
return &a, &b, &c |
| 43 |
} |
| 44 |
|
| 45 |
//export ReturnString |
| 46 |
func ReturnString() string { |
| 47 |
return "hello" |
| 48 |
} |
| 49 |
|
| 50 |
//export ReturnByteSlice |
| 51 |
func ReturnByteSlice() []byte { |
| 52 |
return []byte{1, 2, 3} |
| 53 |
} |
| 54 |
|
| 55 |
//export InputAndReturnUint8 |
| 56 |
func InputAndReturnUint8(a, b, c uint8) (uint8, uint8, uint8) { |
| 57 |
return a, b, c |
| 58 |
} |
| 59 |
|
| 60 |
//export MixedTypes |
| 61 |
func MixedTypes(a uint8, b uint16, c uint32, d uint64, e int, f *int) (uint8, uint16, uint32, uint64, int, *int) { |
| 62 |
return a, b, c, d, e, f |
| 63 |
} |