Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
B
beego
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
go
beego
Commits
8832334d
Commit
8832334d
authored
Jan 06, 2016
by
JessonChan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tiny fix for error description and comment
parent
0b390912
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
memory.go
cache/memory.go
+4
-4
No files found.
cache/memory.go
View file @
8832334d
...
...
@@ -106,7 +106,7 @@ func (bc *MemoryCache) Delete(name string) error {
}
// Incr increase cache counter in memory.
// it supports int,int
64,int32,uint,uint64,uint32
.
// it supports int,int
32,int64,uint,uint32,uint64
.
func
(
bc
*
MemoryCache
)
Incr
(
key
string
)
error
{
bc
.
lock
.
RLock
()
defer
bc
.
lock
.
RUnlock
()
...
...
@@ -117,10 +117,10 @@ func (bc *MemoryCache) Incr(key string) error {
switch
itm
.
val
.
(
type
)
{
case
int
:
itm
.
val
=
itm
.
val
.
(
int
)
+
1
case
int64
:
itm
.
val
=
itm
.
val
.
(
int64
)
+
1
case
int32
:
itm
.
val
=
itm
.
val
.
(
int32
)
+
1
case
int64
:
itm
.
val
=
itm
.
val
.
(
int64
)
+
1
case
uint
:
itm
.
val
=
itm
.
val
.
(
uint
)
+
1
case
uint32
:
...
...
@@ -128,7 +128,7 @@ func (bc *MemoryCache) Incr(key string) error {
case
uint64
:
itm
.
val
=
itm
.
val
.
(
uint64
)
+
1
default
:
return
errors
.
New
(
"item val is not
int int64 int32
"
)
return
errors
.
New
(
"item val is not
(u)int (u)int32 (u)int64
"
)
}
return
nil
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment