File: main.go

package info (click to toggle)
golang-github-fatih-set 0.2.1-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, bullseye-backports, forky, sid, trixie
  • size: 140 kB
  • sloc: makefile: 3
file content (23 lines) | stat: -rw-r--r-- 370 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
package main

import (
	"log"
	"strconv"

	"github.com/fatih/set"
)

func main() {
	log.Print("Initialize our non thread safe Set")
	s := set.New(set.NonThreadSafe)

	log.Print("Add items serially (item1, item2, and so on)")
	for i := 0; i < 10; i++ {
		item := "item" + strconv.Itoa(i)
		log.Print("adding " + item)
		s.Add(item)
	}
	log.Print(s)

	log.Print("Done")
}