Programming/Go
Go/Golang for sets: map[T]struct{} vs. map[T]bool
set이 필요해질때 고민해본 사항인데 마침 눈이 띄어서 짧게 공유해둡니다. empty struct가 재밌는 타입이었네요. for sets: map[T]struct{} vs. map[T]bool I recently saw a colleague using `map[T]struct{}` as a set of unique T. ```go seen := map[string]struct{}{} for _, s := range stuff { if _,... www.reddit.com The empty struct – The acme of foolishness Introduction This post explores the properties of my favourite Go data type, the empty st..