From 75b4bc58965a6b3d8172df7b4b5f34904d04b9a9 Mon Sep 17 00:00:00 2001 From: JessonChan Date: Wed, 3 Apr 2019 10:19:09 +0800 Subject: [PATCH] it's no need to override Trace method. --- controller.go | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/controller.go b/controller.go index 38328c17..0e8853b3 100644 --- a/controller.go +++ b/controller.go @@ -17,6 +17,7 @@ package beego import ( "bytes" "errors" + "fmt" "html/template" "io" "mime/multipart" @@ -27,8 +28,6 @@ import ( "strconv" "strings" - "fmt" - "github.com/astaxie/beego/context" "github.com/astaxie/beego/context/param" "github.com/astaxie/beego/session" @@ -80,15 +79,9 @@ type ControllerComments struct { // ControllerCommentsSlice implements the sort interface type ControllerCommentsSlice []ControllerComments -func (p ControllerCommentsSlice) Len() int { - return len(p) -} -func (p ControllerCommentsSlice) Less(i, j int) bool { - return p[i].Router < p[j].Router -} -func (p ControllerCommentsSlice) Swap(i, j int) { - p[i], p[j] = p[j], p[i] -} +func (p ControllerCommentsSlice) Len() int { return len(p) } +func (p ControllerCommentsSlice) Less(i, j int) bool { return p[i].Router < p[j].Router } +func (p ControllerCommentsSlice) Swap(i, j int) { p[i], p[j] = p[j], p[i] } // Controller defines some basic http request handler operations, such as // http context, template and view, session and xsrf.