Skip to content

Commit

Permalink
Authorize comments in posfile of command goalign replace
Browse files Browse the repository at this point in the history
  • Loading branch information
fredericlemoine committed Oct 14, 2023
1 parent e440260 commit ce2930f
Showing 1 changed file with 21 additions and 18 deletions.
39 changes: 21 additions & 18 deletions cmd/replace.go
Original file line number Diff line number Diff line change
Expand Up @@ -149,26 +149,29 @@ func readreplacefile(file string) (replace []repchar, err error) {
l, e := utils.Readln(r)

for e == nil {
cols := strings.Split(l, "\t")
if cols == nil || len(cols) < 3 {
err = errors.New("bad format from replace char file: There should be 3 columns: seqname\\tsite\\tnewchar")
return
}
// Authorize comments
if !strings.HasPrefix("#") {

Check failure on line 153 in cmd/replace.go

View workflow job for this annotation

GitHub Actions / build

not enough arguments in call to strings.HasPrefix
cols := strings.Split(l, "\t")
if cols == nil || len(cols) < 3 {
err = errors.New("bad format from replace char file: There should be 3 columns: seqname\\tsite\\tnewchar")
return
}

seqname = cols[0]
if site, err = strconv.Atoi(cols[1]); err != nil {
err = fmt.Errorf("cannot convert site index to int")
return
seqname = cols[0]
if site, err = strconv.Atoi(cols[1]); err != nil {
err = fmt.Errorf("cannot convert site index to int")
return
}
newchar = uint8(cols[2][0])

replace = append(
replace,
repchar{
seqname: seqname,
site: site,
newchar: newchar,
})
}
newchar = uint8(cols[2][0])

replace = append(
replace,
repchar{
seqname: seqname,
site: site,
newchar: newchar,
})
l, e = utils.Readln(r)
}
return
Expand Down

0 comments on commit ce2930f

Please sign in to comment.