mirror of
https://github.com/metabarcoding/obitools4.git
synced 2025-06-29 16:20:46 +00:00
Update of obipcr and homogenization of logging
Former-commit-id: 46abf47c19ace5248042c02cf1f81d9f6c12eb10
This commit is contained in:
@ -1,7 +1,7 @@
|
||||
package obilua
|
||||
|
||||
import (
|
||||
"log"
|
||||
log "github.com/sirupsen/logrus"
|
||||
|
||||
lua "github.com/yuin/gopher-lua"
|
||||
)
|
||||
@ -67,13 +67,13 @@ func Table2ByteSlice(interpreter *lua.LState, table *lua.LTable) []byte {
|
||||
v := table.RawGetInt(i)
|
||||
switch v.Type() {
|
||||
case lua.LTNumber:
|
||||
if x:=float64(v.(lua.LNumber)); x <=255 {
|
||||
if x := float64(v.(lua.LNumber)); x <= 255 {
|
||||
val[i-1] = byte(x)
|
||||
} else {
|
||||
log.Fatalf("LUA: Value %f at index %d is to large to be converted to byte", x,i)
|
||||
log.Fatalf("LUA: Value %f at index %d is to large to be converted to byte", x, i)
|
||||
}
|
||||
default:
|
||||
log.Fatalf("LUA: Value %v at index %d cannot be converted to byte", v,i)
|
||||
log.Fatalf("LUA: Value %v at index %d cannot be converted to byte", v, i)
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user