mirror of
https://github.com/HDT3213/godis.git
synced 2025-10-05 16:57:06 +08:00
optimize code style
This commit is contained in:
@@ -33,11 +33,8 @@ func Info(c redis.Connection, args [][]byte) redis.Reply {
|
|||||||
reply := GenGodisInfoString()
|
reply := GenGodisInfoString()
|
||||||
return protocol.MakeBulkReply(reply)
|
return protocol.MakeBulkReply(reply)
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
return protocol.MakeErrReply("ERR wrong number of arguments for 'info' command")
|
|
||||||
}
|
}
|
||||||
|
return protocol.MakeErrReply("ERR wrong number of arguments for 'info' command")
|
||||||
return &protocol.NullBulkReply{}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Auth validate client's password
|
// Auth validate client's password
|
||||||
@@ -64,7 +61,7 @@ func isAuthenticated(c redis.Connection) bool {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func GenGodisInfoString() []byte {
|
func GenGodisInfoString() []byte {
|
||||||
startUpTimeFromNow := getGodisRuninngTime()
|
startUpTimeFromNow := getGodisRunningTime()
|
||||||
s := fmt.Sprintf("# Server\r\n"+
|
s := fmt.Sprintf("# Server\r\n"+
|
||||||
"godis_version:%s\r\n"+
|
"godis_version:%s\r\n"+
|
||||||
//"godis_git_sha1:%s\r\n"+
|
//"godis_git_sha1:%s\r\n"+
|
||||||
@@ -112,7 +109,7 @@ func getGodisRunningMode() string {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// getGodisRuninngTime return the running time of godis
|
// getGodisRunningTime return the running time of godis
|
||||||
func getGodisRuninngTime() time.Duration {
|
func getGodisRunningTime() time.Duration {
|
||||||
return time.Since(config.EachTimeServerInfo.StartUpTime) / time.Second
|
return time.Since(config.EachTimeServerInfo.StartUpTime) / time.Second
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user