initial commit

This commit is contained in:
2025-02-03 16:30:36 -05:00
commit 949fdcb968
13 changed files with 1338 additions and 0 deletions

26
utils.go Normal file
View File

@ -0,0 +1,26 @@
package meater
import (
"reflect"
"time"
"github.com/sirupsen/logrus"
)
// isNil .
func isNil(i interface{}) bool {
if i == nil {
return true
}
switch reflect.TypeOf(i).Kind() {
case reflect.Ptr, reflect.Map, reflect.Array, reflect.Chan, reflect.Slice:
return reflect.ValueOf(i).IsNil()
}
return false
}
// timeTrack .
func timeTrack(name string, log *logrus.Logger) {
start := time.Now()
log.Debugf("%s took %v\n", name, time.Since(start))
}