mirror of
https://github.com/metabarcoding/obitools4.git
synced 2025-12-08 08:40:26 +00:00
Code reefactoring
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
|
||||
@@ -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()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user