chore(lint): address linter
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
@@ -300,7 +300,7 @@ func loggingMiddleware(c *gin.Context) {
|
||||
logData := log.Fields{
|
||||
"type": "access",
|
||||
"ip": c.ClientIP(),
|
||||
"latency": fmt.Sprintf("%s", latency),
|
||||
"latency": latency.String(),
|
||||
"status": c.Writer.Status(),
|
||||
"method": c.Request.Method,
|
||||
"path": c.Request.URL.Path,
|
||||
|
||||
@@ -206,7 +206,7 @@ func (api *API) appGetAdminLogs(c *gin.Context) {
|
||||
rawLog := scanner.Text()
|
||||
|
||||
// Attempt JSON Pretty
|
||||
var jsonMap map[string]interface{}
|
||||
var jsonMap map[string]any
|
||||
err := json.Unmarshal([]byte(rawLog), &jsonMap)
|
||||
if err != nil {
|
||||
logLines = append(logLines, scanner.Text())
|
||||
|
||||
@@ -1057,11 +1057,11 @@ func appErrorPage(c *gin.Context, errorCode int, errorMessage string) {
|
||||
|
||||
func arrangeUserStatistics(userStatistics []database.GetUserStatisticsRow) gin.H {
|
||||
// Item Sorter
|
||||
sortItem := func(userStatistics []database.GetUserStatisticsRow, key string, less func(i int, j int) bool) []map[string]interface{} {
|
||||
sortItem := func(userStatistics []database.GetUserStatisticsRow, key string, less func(i int, j int) bool) []map[string]any {
|
||||
sortedData := append([]database.GetUserStatisticsRow(nil), userStatistics...)
|
||||
sort.SliceStable(sortedData, less)
|
||||
|
||||
newData := make([]map[string]interface{}, 0)
|
||||
newData := make([]map[string]any, 0)
|
||||
for _, item := range sortedData {
|
||||
v := reflect.Indirect(reflect.ValueOf(item))
|
||||
|
||||
@@ -1077,7 +1077,7 @@ func arrangeUserStatistics(userStatistics []database.GetUserStatisticsRow) gin.H
|
||||
value = niceNumbers(rawVal)
|
||||
}
|
||||
|
||||
newData = append(newData, map[string]interface{}{
|
||||
newData = append(newData, map[string]any{
|
||||
"UserID": item.UserID,
|
||||
"Value": value,
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user