Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Koeng101 committed Jan 19, 2024
1 parent 39018eb commit 6260b27
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions api/api/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -305,17 +305,14 @@ func luaStringArrayToGoSlice(L *lua.LState, index int) ([]string, error) {

func (app *App) PostIoFastaParse(ctx context.Context, request gen.PostIoFastaParseRequestObject) (gen.PostIoFastaParseResponseObject, error) {
fastaString := *request.Body
parser, err := bio.NewFastaParser(strings.NewReader(fastaString + "\n"))
if err != nil {
return gen.PostIoFastaParse500TextResponse(fmt.Sprintf("Got error: %s", err)), nil
}
parser := bio.NewFastaParser(strings.NewReader(fastaString + "\n"))
fastas, err := parser.Parse()
if err != nil {
return gen.PostIoFastaParse500TextResponse(fmt.Sprintf("Got error: %s", err)), nil
}
data := make([]gen.FastaRecord, len(fastas))
for i, fastaRecord := range fastas {
data[i] = gen.FastaRecord(*fastaRecord)
data[i] = gen.FastaRecord(fastaRecord)
}
return gen.PostIoFastaParse200JSONResponse(data), nil
}
Expand All @@ -338,10 +335,7 @@ func (app *App) LuaIoFastaWrite(L *lua.LState) int { return 0 }

func (app *App) PostIoGenbankParse(ctx context.Context, request gen.PostIoGenbankParseRequestObject) (gen.PostIoGenbankParseResponseObject, error) {
genbankString := *request.Body
parser, err := bio.NewGenbankParser(strings.NewReader(genbankString + "\n"))
if err != nil {
return gen.PostIoGenbankParse500TextResponse(fmt.Sprintf("Got error: %s", err)), nil
}
parser := bio.NewGenbankParser(strings.NewReader(genbankString + "\n"))
genbanks, err := parser.Parse()
if err != nil {
return gen.PostIoGenbankParse500TextResponse(fmt.Sprintf("Got error: %s", err)), nil
Expand All @@ -352,7 +346,7 @@ func (app *App) PostIoGenbankParse(ctx context.Context, request gen.PostIoGenban
if err != nil {
return gen.PostIoGenbankParse500TextResponse(fmt.Sprintf("Got error: %s", err)), nil
}
data[i] = ConvertGenbankToGenbankRecord(*genbankRecord)
data[i] = ConvertGenbankToGenbankRecord(genbankRecord)
}
return gen.PostIoGenbankParse200JSONResponse(data), nil
}
Expand Down

0 comments on commit 6260b27

Please sign in to comment.