Files
learngo/interfaces/05-log-parser/oop/groupers.go
2019-08-19 10:21:17 +03:00

14 lines
339 B
Go

package main
// domainGrouper groups by domain.
// but it keeps the other fields.
// for example: it returns pages as well, but you shouldn't use them.
// exercise: write a function that erases the unnecessary data.
func domainGrouper(r result) string {
return r.domain
}
func pageGrouper(r result) string {
return r.domain + r.page
}