Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --- File pkg1/a.go
- type A struct {
- b B
- }
- func (a A) YouWanted() string{
- return a.b.ProcessString()
- }
- --- File pkg1/b.go
- type B struct {
- s string
- }
- type (b B) ProcessString() string {
- return strings.TrimPrefix(b.s, "aaaaa")
- }
- --- File pkg2/jonsnow.go
- func JonSnow(something A) string {
- myString := a.YouWanted()
- // JonSnow knows nothing and expect to have a particoular string from this
- //...
- return ""
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement