1
0
Fork 0
gobelt/set
Gregory Eremin 993153693a Move readme parts to their corresponding packages 2018-07-03 20:33:55 +02:00
..
internal Generate proper package names for sets 2018-07-03 19:54:30 +02:00
setint Generate proper package names for sets 2018-07-03 19:54:30 +02:00
setint8 Generate proper package names for sets 2018-07-03 19:54:30 +02:00
setint16 Generate proper package names for sets 2018-07-03 19:54:30 +02:00
setint32 Generate proper package names for sets 2018-07-03 19:54:30 +02:00
setint64 Generate proper package names for sets 2018-07-03 19:54:30 +02:00
setstring Generate proper package names for sets 2018-07-03 19:54:30 +02:00
setuint Generate proper package names for sets 2018-07-03 19:54:30 +02:00
setuint8 Generate proper package names for sets 2018-07-03 19:54:30 +02:00
setuint16 Generate proper package names for sets 2018-07-03 19:54:30 +02:00
setuint32 Generate proper package names for sets 2018-07-03 19:54:30 +02:00
setuint64 Generate proper package names for sets 2018-07-03 19:54:30 +02:00
README.md Move readme parts to their corresponding packages 2018-07-03 20:33:55 +02:00

README.md

Set

Package set is a collection of packages implementing a set data type. Supported types are:

  • int, int8, int16, int32, int64
  • uint, uint8, uint16, uint32, uint64
  • string

All the package names are type names prefixed with "set", e.g. setuint64.

Note: These packages are generated from a template. Instead of modifying each package individually change the template and run make gen.

import "github.com/localhots/gobelt/set/setstring"
s := setstring.New("one", "two")
s.Add("three")
s.Remove("one", "two").Add("four", "five")
fmt.Println("Size:", s.Len()) // 3
fmt.Println("Has one", s.Has("one")) // false
fmt.Println(s.SortedSlice()) // [three four five]