Skip to content

Commit f78617c

Browse files
committed
add func description
1 parent 2faa752 commit f78617c

File tree

6 files changed

+11
-5
lines changed

6 files changed

+11
-5
lines changed

context.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,12 @@ func (c *Context) HandlerName() string {
6363

6464
//Abort abort http response
6565
func (c *Context) AbortCode(statusCode int) {
66-
c.Writer.WriteHeader(statusCode)
66+
c.Status(statusCode)
67+
c.index = abortIndex
68+
}
69+
70+
// StopRun stop run
71+
func (c *Context) StopRun() {
6772
c.index = abortIndex
6873
}
6974

lib/oauth/wechat/client.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ func (c *Client) GetJSAPIConfig(ticket, url string) (data *JSWXConfig, err error
207207
}
208208

209209
//GetPayConfig 获取公众号支付时的参数
210-
//传入payParam为支付下单接口返回的信息
210+
// 传入payParam为支付下单接口返回的信息
211211
func (c *Client) GetPayConfig(payParam string) (payConfig *PayConfig, err error) {
212212
if payParam == "" {
213213
err = fmt.Errorf("[wechat]payParam为空")

logger.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,6 @@ func Logger() HandlerFunc {
1212
return func(c *Context) {
1313
t := time.Now()
1414
c.Next()
15-
fmt.Printf("[%s] %s | %-3d | %-15s| %-5s | %-12s | %s \n", c.engine.AppName, time.Now().Format("2006/01/02 15:04:05"), c.StatusCode, c.GetIP(), c.Req.Method, time.Since(t), c.Req.URL.String())
15+
fmt.Printf("[%s] %s | %-3d | %-15s| %-5s | %-12s | %s \n", c.engine.AppName, time.Now().Format("2006/01/02 15:04:05"), c.Writer.Status(), c.GetIP(), c.Req.Method, time.Since(t), c.Req.URL.String())
1616
}
1717
}

pprof/pprof.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ func getPrefix(prefixOptions ...string) string {
2323
}
2424

2525
// Register the standard HandlerFuncs from the net/http/pprof package with
26-
// the provided gin.Engine. prefixOptions is a optional. If not prefixOptions,
26+
// the provided gow.Engine. prefixOptions is a optional. If not prefixOptions,
2727
// the default path prefix is used, otherwise first prefixOptions will be path prefix.
2828
func Register(r *gow.Engine, prefixOptions ...string) {
2929
RouteRegister(r.RouterGroup, prefixOptions...)

render/template_func.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ func Substr(s string, start, length int) string {
2626
return string(bt[start:end])
2727
}
2828

29+
// Str2html str2 to html code
2930
func Str2html(str string) template.HTML {
3031
return template.HTML(str)
3132
}

response_writer.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ func (w *responseWriter) reset(writer http.ResponseWriter) {
5555

5656
func (w *responseWriter) WriteHeader(code int) {
5757
if code > 0 && w.status != code {
58-
if w.Written() {
58+
if w.Written() {
5959
debugPrint("[WARNING] Headers were already written. Wanted to override status code %d with %d", w.status, code)
6060
}
6161
w.status = code

0 commit comments

Comments
 (0)