File: README.md

package info (click to toggle)
golang-github-cqroot-multichoose 0.1.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 84 kB
  • sloc: makefile: 5
file content (30 lines) | stat: -rw-r--r-- 371 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# MultiChoose

Store multi-choose list state for Go.

## Usage

```go
package main

import (
	"fmt"

	"github.com/cqroot/multichoose"
)

func main() {
	mc := multichoose.New(10)

	// Set the maximum number of items that can be selected
	mc.SetLimit(3)

	mc.Select(1)
	// true
	fmt.Println(mc.IsSelected(1))

	mc.Deselect(1)
	// false
	fmt.Println(mc.IsSelected(1))
}
```