first commit
This commit is contained in:
commit
90a311b094
25
.gitignore
vendored
Normal file
25
.gitignore
vendored
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
# If you prefer the allow list template instead of the deny list, see community template:
|
||||||
|
# https://github.com/github/gitignore/blob/main/community/Golang/Go.AllowList.gitignore
|
||||||
|
#
|
||||||
|
# Binaries for programs and plugins
|
||||||
|
*.exe
|
||||||
|
*.exe~
|
||||||
|
*.dll
|
||||||
|
*.so
|
||||||
|
*.dylib
|
||||||
|
|
||||||
|
# Test binary, built with `go test -c`
|
||||||
|
*.test
|
||||||
|
|
||||||
|
# Output of the go coverage tool, specifically when used with LiteIDE
|
||||||
|
*.out
|
||||||
|
|
||||||
|
# Dependency directories (remove the comment below to include it)
|
||||||
|
# vendor/
|
||||||
|
|
||||||
|
# Go workspace file
|
||||||
|
go.work
|
||||||
|
go.work.sum
|
||||||
|
|
||||||
|
# env file
|
||||||
|
.env
|
7
go.mod
Normal file
7
go.mod
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
module codepractice
|
||||||
|
|
||||||
|
go 1.22.5
|
||||||
|
|
||||||
|
require internal/itertools v0.0.0-00010101000000-000000000000
|
||||||
|
replace internal/itertools => ./internal/itertools
|
||||||
|
|
3
internal/itertools/go.mod
Normal file
3
internal/itertools/go.mod
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
module itertools
|
||||||
|
|
||||||
|
go 1.22.5
|
13
internal/itertools/itertools.go
Normal file
13
internal/itertools/itertools.go
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
package itertools
|
||||||
|
|
||||||
|
type Iterator struct {
|
||||||
|
dict map[string]int
|
||||||
|
}
|
||||||
|
|
||||||
|
func (iterator Iterator) GetCount(items []string) map[string]int {
|
||||||
|
iterator.dict = make(map[string]int)
|
||||||
|
for _, item := range items {
|
||||||
|
iterator.dict[item]++
|
||||||
|
}
|
||||||
|
return iterator.dict
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user