Guest User

Untitled

a guest
Apr 23rd, 2018
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. type Foo struct {
  2. ID int
  3. }
  4.  
  5. type Bar struct {
  6. ID int
  7. }
  8.  
  9. func convertAtoB(a A) *B {
  10. return &B{a.ID}
  11. }
  12.  
  13. func (a* A) convertToB() *B {
  14. return &B{a.ID}
  15. }
  16.  
  17. type Name Struct {
  18. ...
  19. funcSlot interface{}
  20. ...
  21. }
  22.  
  23. func (n *Name) FuncName() error {
  24. return nil
  25. }
  26.  
  27. func NewName() (n *Name) {
  28. ...
  29. n.funcSlot = (*Name).FuncName
  30. ...
  31. }
  32.  
  33. type NAME interface {
  34. ...
  35. FuncName() error
  36. ...
  37. }
Add Comment
Please, Sign In to add comment