refactor: replace iota with explicit values for log type constants
This commit is contained in:
parent
b9c2089d37
commit
812ab67780
15
model/log.go
15
model/log.go
@ -39,14 +39,15 @@ type Log struct {
|
|||||||
Other string `json:"other"`
|
Other string `json:"other"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// don't use iota, avoid change log type value
|
||||||
const (
|
const (
|
||||||
LogTypeUnknown = iota
|
LogTypeUnknown = 0
|
||||||
LogTypeTopup
|
LogTypeTopup = 1
|
||||||
LogTypeConsume
|
LogTypeConsume = 2
|
||||||
LogTypeManage
|
LogTypeManage = 3
|
||||||
LogTypeSystem
|
LogTypeSystem = 4
|
||||||
LogTypeError
|
LogTypeError = 5
|
||||||
LogTypeRefund
|
LogTypeRefund = 6
|
||||||
)
|
)
|
||||||
|
|
||||||
func formatUserLogs(logs []*Log) {
|
func formatUserLogs(logs []*Log) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user