1
0
mirror of https://github.com/astaxie/beego.git synced 2025-06-12 13:00:39 +00:00

fix golint comments

This commit is contained in:
BorisBorshevsky
2017-11-25 19:16:37 +02:00
parent a5dd5d161d
commit df37739c7d
8 changed files with 17 additions and 13 deletions

View File

@ -27,6 +27,7 @@ const (
jsonFormat = "JSON_FORMAT"
)
// AccessLogRecord struct for holding access log data.
type AccessLogRecord struct {
RemoteAddr string `json:"remote_addr"`
RequestTime time.Time `json:"request_time"`
@ -37,8 +38,8 @@ type AccessLogRecord struct {
Status int `json:"status"`
BodyBytesSent int64 `json:"body_bytes_sent"`
ElapsedTime time.Duration `json:"elapsed_time"`
HttpReferrer string `json:"http_referrer"`
HttpUserAgent string `json:"http_user_agent"`
HTTPReferrer string `json:"http_referrer"`
HTTPUserAgent string `json:"http_user_agent"`
RemoteUser string `json:"remote_user"`
}
@ -60,6 +61,7 @@ func disableEscapeHTML(i interface{}) {
}
}
// AccessLog - Format and print access log.
func AccessLog(r *AccessLogRecord, format string) {
var msg string
@ -68,7 +70,7 @@ func AccessLog(r *AccessLogRecord, format string) {
case apacheFormat:
timeFormatted := r.RequestTime.Format("02/Jan/2006 03:04:05")
msg = fmt.Sprintf(apacheFormatPattern, r.RemoteAddr, timeFormatted, r.Request, r.Status, r.BodyBytesSent,
r.ElapsedTime.Seconds(), r.HttpReferrer, r.HttpUserAgent)
r.ElapsedTime.Seconds(), r.HTTPReferrer, r.HTTPUserAgent)
case jsonFormat:
fallthrough
default: