From 9f0bbccb9b4cd4693e1c70e3a4ae90fc222ce863 Mon Sep 17 00:00:00 2001 From: Luc Blassel Date: Sun, 28 Apr 2024 11:37:44 +0200 Subject: [PATCH 1/2] Fixing newick parsing to accepts trailing whitespace after semicolon --- io/fileutils/readln.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/io/fileutils/readln.go b/io/fileutils/readln.go index c23d532..2fc72c8 100644 --- a/io/fileutils/readln.go +++ b/io/fileutils/readln.go @@ -37,7 +37,13 @@ func ReadUntilSemiColon(r *bufio.Reader) (string, error) { line, isPrefix, err = r.ReadLine() ln = append(ln, line...) if len(ln) > 0 { - lastChar = ln[len(ln)-1] + i := len(ln) - 1 + lastChar = ln[i] + // Test what last non-space character of the line is + for (lastChar == ' ' || lastChar == '\t') && i >= 0 { + i-- + lastChar = ln[i] + } } } return string(ln), err From b959a7f3eccdebda804206232a37f1d651f5dd5c Mon Sep 17 00:00:00 2001 From: Luc Blassel Date: Sun, 28 Apr 2024 11:40:24 +0200 Subject: [PATCH 2/2] Specifying bash as test.sh language --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 7198444..6ebca1e 100644 --- a/README.md +++ b/README.md @@ -129,7 +129,7 @@ The `gotree` executable should be located in the current folder (or the `$GOPATH To test the executable: ``` -./test.sh +bash test.sh ``` ## Auto completion