Patch some bugs in writing files

Former-commit-id: 612868a281dc0ecf4e6c5776973735e5c71bd517
This commit is contained in:
Eric Coissac
2024-06-19 13:15:30 +02:00
parent 73996bb0b7
commit 818ce87bab
8 changed files with 75 additions and 22 deletions

View File

@ -2,6 +2,7 @@ package obiseq
import (
"fmt"
"math"
"reflect"
"strings"
@ -120,8 +121,14 @@ func (sequence *BioSequence) StatsPlusOne(key string, toAdd *BioSequence, na str
uint8, uint16, uint32, uint64,
int8, int16, int32, int64, bool:
sval = fmt.Sprint(value)
case float64:
if math.Floor(value) == value {
sval = fmt.Sprint(int(value))
} else {
log.Fatalf("Trying to make stats on a float value (%v : %T)", value, value)
}
default:
log.Fatalf("Trying to make stats on a none string, integer or boolean value (%v)", value)
log.Fatalf("Trying to make stats on a none string, integer or boolean value (%v : %T)", value, value)
}
retval = true
}