diff options
author | Alexander NeonXP Kiryukhin <i@neonxp.ru> | 2024-07-29 02:47:35 +0300 |
---|---|---|
committer | Alexander NeonXP Kiryukhin <i@neonxp.ru> | 2024-07-29 02:47:35 +0300 |
commit | 96e2ce2e9d363a6296f9411ecb00168520258874 (patch) | |
tree | 09aa7fffe10eab84ae0edd39e570355984ba0148 /utils | |
parent | 12ed72e4e1da181a6c87319a50d3b4142788b4c0 (diff) |
Отказ от echo
Diffstat (limited to 'utils')
-rw-r--r-- | utils/date.go | 7 | ||||
-rw-r--r-- | utils/middleware.go | 8 |
2 files changed, 8 insertions, 7 deletions
diff --git a/utils/date.go b/utils/date.go deleted file mode 100644 index 3a6197d..0000000 --- a/utils/date.go +++ /dev/null @@ -1,7 +0,0 @@ -package utils - -import "time" - -func FormatDate(ts int64) string { - return time.Unix(ts, 0).Format("15:04 02.01.2006") -} diff --git a/utils/middleware.go b/utils/middleware.go new file mode 100644 index 0000000..c297d65 --- /dev/null +++ b/utils/middleware.go @@ -0,0 +1,8 @@ +package utils + +import "net/http" + +// Middleware in itself simply takes a http.Handler as the first parameter, wraps +// it and returns a new http.Handler for the server to call (wraps handlers with +// closures according to the principle of Russian doll). +type Middleware func(http.Handler) http.Handler |