Code reefactoring

This commit is contained in:
2022-01-14 16:10:19 +01:00
parent 45a1765a03
commit ff40222902
13 changed files with 68 additions and 92 deletions

View File

@@ -16,15 +16,6 @@ import (
var __FILE_CHUNK_SIZE__ = 1 << 20
func __slice_grow__(slice []string) []string {
return slice
}
type __embl_chunk__ struct {
entries [][]string
order int
}
type __file_chunk__ struct {
raw io.Reader
order int

View File

@@ -7,7 +7,6 @@ package obiformats
import "C"
import (
"errors"
"fmt"
"log"
"os"
@@ -89,7 +88,7 @@ func ReadFastSeqBatchFromFile(filename string, options ...WithOption) (obiseq.IB
err = nil
if pointer == nil {
err = errors.New(fmt.Sprintf("Cannot open file %s", filename))
err = fmt.Errorf("cannot open file %s", filename)
return obiseq.NilIBioSequenceBatch, err
}

View File

@@ -3,7 +3,6 @@ package ncbitaxdump
import (
"bufio"
"encoding/csv"
"errors"
"fmt"
"io"
"log"
@@ -95,8 +94,8 @@ func LoadNCBITaxDump(directory string, onlysn bool) (*obitax.Taxonomy, error) {
nodefile, err := os.Open(path.Join(directory, "nodes.dmp"))
if err != nil {
return nil, errors.New(fmt.Sprintf("Cannot open nodes file from '%s'",
directory))
return nil, fmt.Errorf("cannot open nodes file from '%s'",
directory)
}
defer nodefile.Close()
@@ -112,8 +111,8 @@ func LoadNCBITaxDump(directory string, onlysn bool) (*obitax.Taxonomy, error) {
namefile, nerr := os.Open(path.Join(directory, "names.dmp"))
if nerr != nil {
return nil, errors.New(fmt.Sprintf("Cannot open names file from '%s'",
directory))
return nil, fmt.Errorf("cannot open names file from '%s'",
directory)
}
defer namefile.Close()
@@ -128,8 +127,8 @@ func LoadNCBITaxDump(directory string, onlysn bool) (*obitax.Taxonomy, error) {
aliasfile, aerr := os.Open(path.Join(directory, "merged.dmp"))
if aerr != nil {
return nil, errors.New(fmt.Sprintf("Cannot open merged file from '%s'",
directory))
return nil, fmt.Errorf("cannot open merged file from '%s'",
directory)
}
defer aliasfile.Close()