assertions
ci.vdhsn.com/push Build is passing Details

trunk
Adam Veldhousen 3 years ago
parent e54af4e2b5
commit 37b69c5da4
Signed by: adam
GPG Key ID: 6DB29003C6DD1E4B

@ -111,6 +111,8 @@ func (ss *Sqlite) GetLogAggregate(la LogAggregateInput) (LogAggregate, error) {
timeIndex := int(l.Started.Sub(la.Start)/time.Second) / la.IntervalSeconds
AssertFail(timeIndex >= len(dataset), "ERROR TIME INDEX OUT OF RANGE %d/%d", timeIndex, len(dataset))
ladp := dataset[timeIndex]
ladp.Header = k
offsetSecs := (timeIndex * la.IntervalSeconds)

@ -0,0 +1,15 @@
package internal
import "log"
func AssertFail(condition bool, fmtStr string, params ...interface{}) {
if condition {
log.Panicf(fmtStr, params...)
}
}
func Assert(condition bool, fmtStr string, params ...interface{}) {
if condition {
log.Printf(fmtStr, params...)
}
}
Loading…
Cancel
Save