30 lines
485 B
Go
30 lines
485 B
Go
package main
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
"../../custom-set"
|
|
)
|
|
|
|
func main() {
|
|
fmt.Println("Creating Set 1")
|
|
s1 := stringset.NewFromSlice([]string{"a"})
|
|
addAndOutput(s1, "b")
|
|
addAndOutput(s1, "d")
|
|
addAndOutput(s1, "c")
|
|
s1.PrettyPrint()
|
|
return
|
|
addAndOutput(s1, "0")
|
|
addAndOutput(s1, "aa")
|
|
addAndOutput(s1, "aaa")
|
|
}
|
|
|
|
func addAndOutput(s stringset.Set, val string) {
|
|
fmt.Println("Adding new value: " + val)
|
|
s.Add(val)
|
|
}
|
|
|
|
func delAndOutput(s stringset.Set, val string) {
|
|
s.Delete(val)
|
|
}
|