Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- type SelectionType int
- const (
- LeftSelection int = iota
- RightSelection
- TopSelection
- NoSelection
- )
- type Selection interface{
- ...
- }
- type LeftSelection struct {
- ...
- }
- func NewLeftSelection() *LeftSelection {
- return &LeftSelection{}
- }
- {
- switch SelectionType(kind) {
- case LeftSelection:
- thing = NewLeftSelection()
- case RightSelection:
- thing = NewRightSelection()
- case TopSelection:
- thing = NewTopSelection()
- case NoSelection:
- // nop
- }
- }
Add Comment
Please, Sign In to add comment