Source file
test/abi/struct_3_string_input.go
1
2
3
4
5
6
7
8
9
10
11
12
13 package main
14
15 import (
16 "fmt"
17 )
18
19 var sink *string
20
21 type toobig struct {
22 a, b, c string
23 }
24
25
26
27 func H(x toobig) string {
28 return x.a + " " + x.b + " " + x.c
29 }
30
31 func main() {
32 s := H(toobig{"Hello", "there,", "World"})
33 gotVsWant(s, "Hello there, World")
34 }
35
36 func gotVsWant(got, want string) {
37 if got != want {
38 fmt.Printf("FAIL, got %s, wanted %s\n", got, want)
39 }
40 }
41
View as plain text