mirror of
https://github.com/metabarcoding/obitools4.git
synced 2025-06-29 16:20:46 +00:00
First version of obicleandb...
Former-commit-id: e60b61d015abbf029a555b51de99b4252c50ab59
This commit is contained in:
@ -172,6 +172,26 @@ func (s *BioSequence) GetIntAttribute(key string) (int, bool) {
|
||||
return val, ok
|
||||
}
|
||||
|
||||
func (s *BioSequence) GetFloatAttribute(key string) (float64, bool) {
|
||||
var val float64
|
||||
var err error
|
||||
|
||||
v, ok := s.GetAttribute(key)
|
||||
|
||||
if ok {
|
||||
val, ok = v.(float64)
|
||||
if !ok {
|
||||
val, err = obiutils.InterfaceToFloat64(v)
|
||||
ok = err == nil
|
||||
if ok {
|
||||
s.SetAttribute(key, val)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return val, ok
|
||||
}
|
||||
|
||||
// DeleteAttribute deletes the attribute with the given key from the BioSequence.
|
||||
//
|
||||
// Parameters:
|
||||
|
Reference in New Issue
Block a user