ce332713 by 傅小黑

gofmt commented go files

1 parent b459cf23
...@@ -10,7 +10,7 @@ import ( ...@@ -10,7 +10,7 @@ import (
10 "github.com/astaxie/beego/context" 10 "github.com/astaxie/beego/context"
11 ) 11 )
12 12
13 // FitlerFunc defines filter function type. 13 // FilterFunc defines filter function type.
14 type FilterFunc func(*context.Context) 14 type FilterFunc func(*context.Context)
15 15
16 // App defines beego application with a new PatternServeMux. 16 // App defines beego application with a new PatternServeMux.
......
...@@ -127,7 +127,7 @@ func init() { ...@@ -127,7 +127,7 @@ func init() {
127 127
128 UseFcgi = false 128 UseFcgi = false
129 129
130 MaxMemory = 1<<26 //64MB 130 MaxMemory = 1 << 26 //64MB
131 131
132 EnableGzip = false 132 EnableGzip = false
133 133
......
...@@ -144,15 +144,15 @@ func (c *Controller) RenderBytes() ([]byte, error) { ...@@ -144,15 +144,15 @@ func (c *Controller) RenderBytes() ([]byte, error) {
144 //if the controller has set layout, then first get the tplname's content set the content to the layout 144 //if the controller has set layout, then first get the tplname's content set the content to the layout
145 if c.Layout != "" { 145 if c.Layout != "" {
146 if c.TplNames == "" { 146 if c.TplNames == "" {
147 c.TplNames = strings.ToLower(c.controllerName)+"/"+strings.ToLower(c.actionName)+"." + c.TplExt 147 c.TplNames = strings.ToLower(c.controllerName) + "/" + strings.ToLower(c.actionName) + "." + c.TplExt
148 } 148 }
149 if RunMode == "dev" { 149 if RunMode == "dev" {
150 BuildTemplate(ViewsPath) 150 BuildTemplate(ViewsPath)
151 } 151 }
152 newbytes := bytes.NewBufferString("") 152 newbytes := bytes.NewBufferString("")
153 if _, ok := BeeTemplates[c.TplNames]; !ok { 153 if _, ok := BeeTemplates[c.TplNames]; !ok {
154 panic("can't find templatefile in the path:"+c.TplNames) 154 panic("can't find templatefile in the path:" + c.TplNames)
155 return []byte{}, errors.New("can't find templatefile in the path:"+c.TplNames) 155 return []byte{}, errors.New("can't find templatefile in the path:" + c.TplNames)
156 } 156 }
157 err := BeeTemplates[c.TplNames].ExecuteTemplate(newbytes, c.TplNames, c.Data) 157 err := BeeTemplates[c.TplNames].ExecuteTemplate(newbytes, c.TplNames, c.Data)
158 if err != nil { 158 if err != nil {
...@@ -171,15 +171,15 @@ func (c *Controller) RenderBytes() ([]byte, error) { ...@@ -171,15 +171,15 @@ func (c *Controller) RenderBytes() ([]byte, error) {
171 return icontent, nil 171 return icontent, nil
172 } else { 172 } else {
173 if c.TplNames == "" { 173 if c.TplNames == "" {
174 c.TplNames = strings.ToLower(c.controllerName)+"/"+strings.ToLower(c.actionName)+"." + c.TplExt 174 c.TplNames = strings.ToLower(c.controllerName) + "/" + strings.ToLower(c.actionName) + "." + c.TplExt
175 } 175 }
176 if RunMode == "dev" { 176 if RunMode == "dev" {
177 BuildTemplate(ViewsPath) 177 BuildTemplate(ViewsPath)
178 } 178 }
179 ibytes := bytes.NewBufferString("") 179 ibytes := bytes.NewBufferString("")
180 if _, ok := BeeTemplates[c.TplNames]; !ok { 180 if _, ok := BeeTemplates[c.TplNames]; !ok {
181 panic("can't find templatefile in the path:"+c.TplNames) 181 panic("can't find templatefile in the path:" + c.TplNames)
182 return []byte{}, errors.New("can't find templatefile in the path:"+c.TplNames) 182 return []byte{}, errors.New("can't find templatefile in the path:" + c.TplNames)
183 } 183 }
184 err := BeeTemplates[c.TplNames].ExecuteTemplate(ibytes, c.TplNames, c.Data) 184 err := BeeTemplates[c.TplNames].ExecuteTemplate(ibytes, c.TplNames, c.Data)
185 if err != nil { 185 if err != nil {
...@@ -219,7 +219,7 @@ func (c *Controller) UrlFor(endpoint string, values ...string) string { ...@@ -219,7 +219,7 @@ func (c *Controller) UrlFor(endpoint string, values ...string) string {
219 return "" 219 return ""
220 } 220 }
221 if endpoint[0] == '.' { 221 if endpoint[0] == '.' {
222 return UrlFor(reflect.Indirect(reflect.ValueOf(c.AppController)).Type().Name() + endpoint, values...) 222 return UrlFor(reflect.Indirect(reflect.ValueOf(c.AppController)).Type().Name()+endpoint, values...)
223 } else { 223 } else {
224 return UrlFor(endpoint, values...) 224 return UrlFor(endpoint, values...)
225 } 225 }
...@@ -327,7 +327,7 @@ func (c *Controller) SaveToFile(fromfile, tofile string) error { ...@@ -327,7 +327,7 @@ func (c *Controller) SaveToFile(fromfile, tofile string) error {
327 return err 327 return err
328 } 328 }
329 defer file.Close() 329 defer file.Close()
330 f, err := os.OpenFile(tofile, os.O_WRONLY | os.O_CREATE | os.O_TRUNC, 0666) 330 f, err := os.OpenFile(tofile, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, 0666)
331 if err != nil { 331 if err != nil {
332 return err 332 return err
333 } 333 }
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!