Skip to content

Commit 807b48d

Browse files
authored
Merge pull request #111 from andrewpmartinez/add.v2.for.generics
adds v2 to module name, fixes readme
2 parents b1f44ce + d6f6556 commit 807b48d

File tree

4 files changed

+5
-6
lines changed

4 files changed

+5
-6
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.idea/

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ notifications:
2222
email: false
2323

2424
before_script:
25-
- curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- -b $(go env GOPATH)/bin latest
25+
- go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest
2626

2727
# script always runs to completion (set +e). If we have linter issues AND a
2828
# failing test, we want to see both. Configure golangci-lint with a

README.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,13 @@ The package is now imported under the "cmap" namespace.
2626
```go
2727

2828
// Create a new map.
29-
m := cmap.New()
29+
m := cmap.New[string]()
3030

3131
// Sets item within map, sets "bar" under key "foo"
3232
m.Set("foo", "bar")
3333

3434
// Retrieve item from map.
35-
if tmp, ok := m.Get("foo"); ok {
36-
bar := tmp.(string)
37-
}
35+
bar, ok := m.Get("foo")
3836

3937
// Removes item under key "foo"
4038
m.Remove("foo")

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
module github.com/orcaman/concurrent-map
1+
module github.com/orcaman/concurrent-map/v2
22

33
go 1.18

0 commit comments

Comments
 (0)