1
0
mirror of https://github.com/go-gitea/gitea.git synced 2024-05-11 05:55:29 +00:00

Removed unnecessary conversions (#7557)

No need to convert to the same type.
This commit is contained in:
Christian Muehlhaeuser
2019-07-23 20:50:39 +02:00
committed by zeripath
parent 2f75766532
commit 54d96c79b5
24 changed files with 39 additions and 46 deletions

View File

@ -378,9 +378,9 @@ func (cv *ColoredValue) Format(s fmt.State, c rune) {
return
}
}
s.Write([]byte(*cv.colorBytes))
s.Write(*cv.colorBytes)
fmt.Fprintf(&protectedANSIWriter{w: s}, fmtString(s, c), *(cv.Value))
s.Write([]byte(*cv.resetBytes))
s.Write(*cv.resetBytes)
}
// SetColorBytes will allow a user to set the colorBytes of a colored value

View File

@ -101,7 +101,7 @@ func (l *Level) UnmarshalJSON(b []byte) error {
switch v := tmp.(type) {
case string:
*l = FromString(string(v))
*l = FromString(v)
case int:
*l = FromString(Level(v).String())
default:

View File

@ -203,7 +203,7 @@ func (logger *WriterLogger) createMsg(buf *[]byte, event *Event) {
(&protectedANSIWriter{
w: &baw,
mode: pawMode,
}).Write([]byte(msg))
}).Write(msg)
*buf = baw
if event.stacktrace != "" && logger.StacktraceLevel <= event.level {