Skip to content

Commit

Permalink
Merge pull request #4 from TriggerMail/dangermike/NOTICKET/go_115
Browse files Browse the repository at this point in the history
Go 1.15 and other updates
  • Loading branch information
dangermike authored Jan 11, 2021
2 parents 2680719 + b393019 commit 8632828
Show file tree
Hide file tree
Showing 6 changed files with 91 additions and 99 deletions.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2020 Bluecore
Copyright (c) 2020-2021 Bluecore

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
18 changes: 9 additions & 9 deletions expected_stats_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"testing"

"github.com/TriggerMail/lazylru"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)

type ExpectedStats struct {
Expand Down Expand Up @@ -60,34 +60,34 @@ func (es ExpectedStats) WithReaperCycles(v uint32) ExpectedStats {

func (es ExpectedStats) Test(t *testing.T, stats lazylru.Stats) {
if es.KeysWritten != nil {
assert.Equal(t, int(*es.KeysWritten), int(stats.KeysWritten), "keys written")
require.Equal(t, int(*es.KeysWritten), int(stats.KeysWritten), "keys written")
}

if es.KeysReadOK != nil {
assert.Equal(t, int(*es.KeysReadOK), int(stats.KeysReadOK), "keys read ok")
require.Equal(t, int(*es.KeysReadOK), int(stats.KeysReadOK), "keys read ok")
}

if es.KeysReadNotFound != nil {
assert.Equal(t, int(*es.KeysReadNotFound), int(stats.KeysReadNotFound), "keys read not found")
require.Equal(t, int(*es.KeysReadNotFound), int(stats.KeysReadNotFound), "keys read not found")
}

if es.KeysReadExpired != nil {
assert.Equal(t, int(*es.KeysReadExpired), int(stats.KeysReadExpired), "keys read expired")
require.Equal(t, int(*es.KeysReadExpired), int(stats.KeysReadExpired), "keys read expired")
}

if es.Shuffles != nil {
assert.Equal(t, int(*es.Shuffles), int(stats.Shuffles), "shuffles")
require.Equal(t, int(*es.Shuffles), int(stats.Shuffles), "shuffles")
}

if es.Evictions != nil {
assert.Equal(t, int(*es.Evictions), int(stats.Evictions), "evictions")
require.Equal(t, int(*es.Evictions), int(stats.Evictions), "evictions")
}

if es.KeysReaped != nil {
assert.Equal(t, int(*es.KeysReaped), int(stats.KeysReaped), "keys reaped")
require.Equal(t, int(*es.KeysReaped), int(stats.KeysReaped), "keys reaped")
}

if es.ReaperCycles != nil {
assert.Equal(t, int(*es.ReaperCycles), int(stats.ReaperCycles), "reaper cycles")
require.Equal(t, int(*es.ReaperCycles), int(stats.ReaperCycles), "reaper cycles")
}
}
3 changes: 1 addition & 2 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
module github.com/TriggerMail/lazylru

go 1.14
go 1.15

require (
github.com/stretchr/testify v1.5.1
go.uber.org/multierr v1.5.0 // indirect
go.uber.org/zap v1.15.0
golang.org/x/lint v0.0.0-20200302205851-738671d3881b // indirect
golang.org/x/tools v0.0.0-20200519205726-57a9e4404bf7 // indirect
Expand Down
9 changes: 1 addition & 8 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,12 @@ github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81P
github.com/stretchr/testify v1.5.1 h1:nOGnQDM7FYENwehXlg/kFVnos3rEvtKTjRvOWSzb6H4=
github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA=
github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
go.uber.org/atomic v1.5.0 h1:OI5t8sDa1Or+q8AeE+yKeB/SDYioSHAgcVljj9JIETY=
go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ=
go.uber.org/atomic v1.6.0 h1:Ezj3JGmsOnG1MoRWQkPBsKLe9DwWD9QeXzTRzzldNVk=
go.uber.org/atomic v1.6.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ=
go.uber.org/multierr v1.3.0 h1:sFPn2GLc3poCkfrpIXGhBD2X0CMIo4Q/zSULXrj/+uc=
go.uber.org/multierr v1.3.0/go.mod h1:VgVr7evmIr6uPjLBxg28wmKNXyqE9akIJ5XnfpiKl+4=
go.uber.org/multierr v1.5.0 h1:KCa4XfM8CWFCpxXRGok+Q0SS/0XBhMDbHHGABQLvD2A=
go.uber.org/multierr v1.5.0/go.mod h1:FeouvMocqHpRaaGuG9EjoKcStLC43Zu/fmqdUMPcKYU=
go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee h1:0mgffUl7nfd+FpvXMVz4IDEaUSmT1ysygQC7qYo7sG4=
go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA=
go.uber.org/zap v1.14.0 h1:/pduUoebOeeJzTDFuoMgC6nRkiasr1sBCIEorly7m4o=
go.uber.org/zap v1.14.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM=
go.uber.org/zap v1.15.0 h1:ZZCA22JRF2gQE5FoNmhmrf7jeJJ2uhqDUNRYKm8dvmM=
go.uber.org/zap v1.15.0/go.mod h1:Mb2vm2krFEG5DV0W9qcHBYFtp/Wku1cvYaqPsS/WYfc=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
Expand Down Expand Up @@ -65,8 +59,7 @@ golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5/go.mod h1:b+2E5dAYhXwXZwtn
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
golang.org/x/tools v0.0.0-20200306191617-51e69f71924f h1:bFIWQKTZ5vXyr7xMDvzbWUj5Y/WBE4a4sf35MAyZjx0=
golang.org/x/tools v0.0.0-20200306191617-51e69f71924f/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw=
golang.org/x/tools v0.0.0-20200519205726-57a9e4404bf7 h1:nm4zDh9WvH4jiuUpMY5RUsvOwrtTVVAsUaCdLW71hfY=
golang.org/x/tools v0.0.0-20200519205726-57a9e4404bf7/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
Expand Down
Loading

0 comments on commit 8632828

Please sign in to comment.