diff options
-rw-r--r-- | obo.go | 15 | ||||
-rw-r--r-- | obo_test.go | 1 |
2 files changed, 10 insertions, 6 deletions
@@ -89,7 +89,8 @@ func parseObo(oboinput bufio.Reader, obochan chan *OboTermEntry, parentchildren fmt.Fprintf(os.Stderr, "Chopped line number: %d\n", lineno) } - if line == "[Term]" { + switch line { + case "[Term]": termsstarted = true if entry != nil { obochan <- entry @@ -97,14 +98,16 @@ func parseObo(oboinput bufio.Reader, obochan chan *OboTermEntry, parentchildren entry = new(OboTermEntry) continue - } else if line == "\n" { + case "\n": continue - } else if line == "[Typedef]" { + case "[Typedef]": continue - } else if line == "" { - continue - } else if line[0] == '!' { + case "": continue + default: + if line[0] == '!' { + continue + } } if termsstarted { diff --git a/obo_test.go b/obo_test.go index 140f948..98afe1f 100644 --- a/obo_test.go +++ b/obo_test.go @@ -27,6 +27,7 @@ name: part_of [Term] id: SYMP:0000000 +! We do not care about this comment name: cellulitis def: "Cellulitis is a musculoskeletal system symptom characterized as a diffuse and especially subcutaneous inflammation of connective tissue." [URL:http\://www2.merriam-webster.com/cgi-bin/mwmednlm?book=Medical&va=cellulitis] is_a: SYMP:0000891 ! musculoskeletal system symptom |