Advertisement
Guest User

Untitled

a guest
Sep 25th, 2017
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. type ControllerInterface {
  2. ControlStuff(state int) (action int)
  3. }
  4.  
  5. type Controller1 struct {
  6. someData string
  7. }
  8. func (c *Controller1) ControlStuff(state int) (action int) {
  9. if c.someData = "5" {
  10. return 0
  11. }
  12. return 1
  13. }
  14. func (c *Controller1) Load(d string) {
  15. c.someData = d
  16. }
  17.  
  18. type Controller2 struct {
  19. someData int
  20. }
  21. func (c *Controller2) ControlStuff(state int) (action int) {
  22. if c.someData = 5 {
  23. return 0
  24. }
  25. return 1
  26. }
  27. func (c *Controller2) Load(d int) {
  28. c.someData = d
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement