fix: 修改多个处理函数的返回类型为指针类型,以提高内存使用效率并避免不必要的拷贝
This commit is contained in:
@@ -18,7 +18,7 @@ func init() {
|
||||
handler.RegisterHelpInform("reboot", "docker", "reboot 重启环境")
|
||||
}
|
||||
|
||||
func runInDocker(msg model.Message) (reply model.Reply) {
|
||||
func runInDocker(msg model.Message) (reply *model.Reply) {
|
||||
token := util.SplitN(msg.RawMsg, 2)
|
||||
if len(token) < 2 {
|
||||
reply.ReplyMsg = "Usage: exec <command>"
|
||||
@@ -47,7 +47,7 @@ func runInDocker(msg model.Message) (reply model.Reply) {
|
||||
}
|
||||
}
|
||||
|
||||
func restartDocker(msg model.Message) (reply model.Reply) {
|
||||
func restartDocker(msg model.Message) (reply *model.Reply) {
|
||||
if err := exec.DockerContainer.RestartAndCleanContainer(); err != nil {
|
||||
reply.ReplyMsg = "Error: " + err.Error()
|
||||
reply.ReferOriginMsg = true
|
||||
|
||||
Reference in New Issue
Block a user