I was using this set library golang-set. I get the following error when trying to create a set:
invalid operation: cannot index mapset.NewSet (value of type func(s ...interface{}) mapset.Set)
Here is the full code
package main
import (
mapset "github.com/deckarep/golang-set"
)
func main() {
mySet := mapset.NewSet[string]()
}
I'm using go version 1.18.2 on Ubuntu, the code is exactly how it appears on the documentation.