1
2
3
4
5 package server
6
7 import (
8 "context"
9 "errors"
10 )
11
12 type A struct {
13 x int
14 }
15
16 func (a *A) AMethod(y int) *Server {
17 return nil
18 }
19
20
21 type FooServer Server
22
23 func (f *FooServer) WriteEvents(ctx context.Context, x int) error {
24 return errors.New("hey!")
25 }
26
27 type Server struct {
28 FooServer *FooServer
29 user string
30 ctx context.Context
31 }
32
33 func New(sctx context.Context, u string) (*Server, error) {
34 s := &Server{user: u, ctx: sctx}
35 s.FooServer = (*FooServer)(s)
36 return s, nil
37 }
38
View as plain text