Skip to content

Commit a9b7f82

Browse files
authored
Merge pull request #66 from swithek/type-params
Use type parameters
2 parents d454340 + 9f34b6b commit a9b7f82

File tree

11 files changed

+344
-311
lines changed

11 files changed

+344
-311
lines changed

.travis.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
language: go
22

33
go:
4-
- "1.17.x"
5-
- "1.16.x"
4+
- tip
65

76
git:
87
depth: 1
@@ -20,4 +19,4 @@ script:
2019
- go test -cover -race -count=1 -timeout=30s -run .
2120
- go test -covermode=count -coverprofile=coverage.out -timeout=90s -run .
2221
- if test ! -z "$COVERALLS_TOKEN"; then $HOME/gopath/bin/goveralls -coverprofile=coverage.out -service=travis-ci -repotoken $COVERALLS_TOKEN; fi
23-
- cd bench; go test -run=Bench.* -bench=. -benchmem; cd ..
22+
- cd bench; go test -run=Bench.* -bench=. -benchmem; cd ..
File renamed without changes.

bench/bench_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import (
99
)
1010

1111
func BenchmarkCacheSetWithoutTTL(b *testing.B) {
12-
cache := ttlcache.NewCache()
12+
cache := ttlcache.NewCache[string, string]()
1313
defer cache.Close()
1414

1515
for n := 0; n < b.N; n++ {
@@ -18,7 +18,7 @@ func BenchmarkCacheSetWithoutTTL(b *testing.B) {
1818
}
1919

2020
func BenchmarkCacheSetWithGlobalTTL(b *testing.B) {
21-
cache := ttlcache.NewCache()
21+
cache := ttlcache.NewCache[string, string]()
2222
defer cache.Close()
2323

2424
cache.SetTTL(time.Duration(50 * time.Millisecond))
@@ -28,7 +28,7 @@ func BenchmarkCacheSetWithGlobalTTL(b *testing.B) {
2828
}
2929

3030
func BenchmarkCacheSetWithTTL(b *testing.B) {
31-
cache := ttlcache.NewCache()
31+
cache := ttlcache.NewCache[string, string]()
3232
defer cache.Close()
3333

3434
for n := 0; n < b.N; n++ {

0 commit comments

Comments
 (0)