github.com/coming-chat/gomobile@v0.0.0-20220601074111-56995f7d7aba/bind/testdata/structs.go (about) 1 // Copyright 2014 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 structs 6 7 type S struct { 8 X, Y float64 9 unexported bool 10 } 11 12 func (s *S) Sum() float64 { 13 return s.X + s.Y 14 } 15 16 func (s *S) Identity() (*S, error) { 17 return s, nil 18 } 19 20 func Identity(s *S) *S { 21 return s 22 } 23 24 func IdentityWithError(s *S) (*S, error) { 25 return s, nil 26 } 27 28 type ( 29 S2 struct{} 30 I interface { 31 M() 32 } 33 ) 34 35 func (s *S2) M() { 36 } 37 38 func (_ *S2) String() string { 39 return "" 40 } 41 42 // Structs is a struct with the same name as its package. 43 type Structs struct{} 44 45 func (_ *Structs) M() { 46 }