16 lines
282 B
Go
16 lines
282 B
Go
package middleware
|
|
|
|
import (
|
|
"encoding/json"
|
|
"time"
|
|
)
|
|
|
|
// jsonUnmarshal и timeNow вынесены для простоты тестирования.
|
|
func jsonUnmarshal(data []byte, v any) error {
|
|
return json.Unmarshal(data, v)
|
|
}
|
|
|
|
func timeNow() time.Time {
|
|
return time.Now()
|
|
}
|