Go doesn't have a built-in set type. Use a map with bool values:
seen := make(map[string]bool)
seen["apple"] = true
seen["banana"] = true
if seen["apple"] {
fmt.Println("Already in set")
}
For memory efficiency, use an empty struct as the value:
seen := make(map[string]struct{})
seen["apple"] = struct{}{}
The empty struct takes no memory.