From e5835310cc520859c56260b2bcaa69a7919788d7 Mon Sep 17 00:00:00 2001 From: Eric Coissac Date: Tue, 31 Jan 2023 17:16:55 +0100 Subject: [PATCH] Simplify code of the JSON header formater --- pkg/obiformats/fastseq_json_header.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/obiformats/fastseq_json_header.go b/pkg/obiformats/fastseq_json_header.go index c592d39..a921707 100644 --- a/pkg/obiformats/fastseq_json_header.go +++ b/pkg/obiformats/fastseq_json_header.go @@ -48,13 +48,13 @@ func _parse_json_header_(header string, annotations obiseq.Annotation) string { for k, v := range annotations { switch vt := v.(type) { - case float64 : + case float64: if vt == math.Floor(vt) { annotations[k] = int(vt) } } } - + if err != nil { log.Fatalf("annotation parsing error on %s : %v\n", header, err) } @@ -70,7 +70,7 @@ func ParseFastSeqJsonHeader(sequence *obiseq.BioSequence) { func FormatFastSeqJsonHeader(sequence *obiseq.BioSequence) string { annotations := sequence.Annotations() - if annotations != nil && len(annotations) > 0 { + if len(annotations) > 0 { text, err := goutils.JsonMarshal(sequence.Annotations()) if err != nil {