Skip to content

mazezen/count-repeat

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

count-repeat

count repeat item in slice. not contain self item.

Install

go get github.com/mazezen/count-repeat

Example

fmt.Println(Count([]interface{}{"10", "20", "600", "20", "30"}))
fmt.Println(Count([]interface{}{"20", "20", "600", "20", "30"}))
fmt.Println(Count([]interface{}{"600", "20", "600", "20", "30"}))
fmt.Println(Count([]interface{}{"20", "20", "600", "20", "30"}))
fmt.Println(Count([]interface{}{"80", "20", "600", "20", "30"}))
fmt.Println(Count([]interface{}{"100", "20", "600", "20", "30"}))
1
2
1
2
1
1
--- PASS: TestCount (0.00s)

About

count repeat item in string slice

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages