mirror of
https://github.com/metabarcoding/obitools4.git
synced 2025-06-29 16:20:46 +00:00
Patch a bug in the new version of setDefinition()
Former-commit-id: 9a382d9891e158dd3d445bfb4053691739ca9fdb
This commit is contained in:
@ -324,7 +324,21 @@ func (s *BioSequence) SetId(id string) {
|
|||||||
//
|
//
|
||||||
// It takes a string parameter 'definition' and assigns it to the 'definition' field of the BioSequence struct.
|
// It takes a string parameter 'definition' and assigns it to the 'definition' field of the BioSequence struct.
|
||||||
func (s *BioSequence) SetDefinition(definition string) {
|
func (s *BioSequence) SetDefinition(definition string) {
|
||||||
|
if definition != "" {
|
||||||
s.SetAttribute("definition", definition)
|
s.SetAttribute("definition", definition)
|
||||||
|
} else {
|
||||||
|
s.RemoveAttribute("definition")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (s *BioSequence) RemoveAttribute(key string) {
|
||||||
|
if s.HasAnnotation() {
|
||||||
|
if s.HasAttribute(key) {
|
||||||
|
defer s.AnnotationsUnlock()
|
||||||
|
s.AnnotationsLock()
|
||||||
|
delete(s.annotations, key)
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// SetSource sets the source of the BioSequence.
|
// SetSource sets the source of the BioSequence.
|
||||||
|
Reference in New Issue
Block a user