refactor: replace iota with explicit values for log type constants

This commit is contained in:
CaIon
2025-10-15 19:54:13 +08:00
parent b9c2089d37
commit 812ab67780
+8 -7
View File
@@ -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) {