// Created on savesnippets.com ยท https://savesnippets.com/yQDHKOZjmNAmC0 package main import "fmt" func main() { // Set of strings โ€” value type is struct{}, takes ZERO bytes per entry seen := make(map[string]struct{}) seen["alice"] = struct{}{} seen["bob"] = struct{}{} // Lookup if _, ok := seen["alice"]; ok { fmt.Println("alice was seen") } // Compare to map[string]bool โ€” bool takes 1 byte per entry; struct{} 0 fmt.Println(len(seen)) // 2 // Signal channel โ€” no data, just "something happened" done := make(chan struct{}) go func() { // ... work ... done <- struct{}{} }() <-done fmt.Println("done received") }