Guest User

Untitled

a guest
Jun 21st, 2018
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1. type SelectionType int
  2.  
  3. const (
  4. LeftSelection int = iota
  5. RightSelection
  6. TopSelection
  7. NoSelection
  8. )
  9.  
  10. type Selection interface{
  11. ...
  12. }
  13.  
  14. type LeftSelection struct {
  15. ...
  16. }
  17.  
  18. func NewLeftSelection() *LeftSelection {
  19. return &LeftSelection{}
  20. }
  21.  
  22. {
  23. switch SelectionType(kind) {
  24. case LeftSelection:
  25. thing = NewLeftSelection()
  26. case RightSelection:
  27. thing = NewRightSelection()
  28. case TopSelection:
  29. thing = NewTopSelection()
  30. case NoSelection:
  31. // nop
  32. }
  33. }
Add Comment
Please, Sign In to add comment