deckarep / golang-set

A simple, battle-tested and generic set type for the Go language. Trusted by Docker, 1Password, Ethereum and Hashicorp.
Other
4k stars 272 forks source link

Please update the examples! #98

Closed Anangaya closed 2 years ago

Anangaya commented 2 years ago

I'm not sure if it's just me, but nothing worked for me (not even the examples!) after the new update. Code_fWgCmd3Rs9

If the examples are broken please fix them.

SennayT commented 2 years ago

I had the same problem, import as

import (
    mapset "github.com/deckarep/golang-set/v2"
)

In go.mod update golang-set to version 2xx (as of writing it is at 2.1.0)

require github.com/deckarep/golang-set/v2 v2.1.0

here is the go file image

here is go.mod image

I think the import in the documentation is for version 1

deckarep commented 2 years ago

Sorry about this, I have updated the readme with the relevant import fixed. Please let me know if that addresses this issue and feel free to re-open.