mirror of
https://github.com/metabarcoding/obitools4.git
synced 2026-04-30 12:00:39 +00:00
rename the iterator class
This commit is contained in:
@@ -67,9 +67,9 @@ func _ExpandListOfFiles(check_ext bool, filenames ...string) ([]string, error) {
|
||||
return list_of_files, nil
|
||||
}
|
||||
|
||||
func ReadBioSequences(filenames ...string) (obiiter.IBioSequenceBatch, error) {
|
||||
var iterator obiiter.IBioSequenceBatch
|
||||
var reader func(string, ...obiformats.WithOption) (obiiter.IBioSequenceBatch, error)
|
||||
func ReadBioSequences(filenames ...string) (obiiter.IBioSequence, error) {
|
||||
var iterator obiiter.IBioSequence
|
||||
var reader func(string, ...obiformats.WithOption) (obiiter.IBioSequence, error)
|
||||
|
||||
opts := make([]obiformats.WithOption, 0, 10)
|
||||
|
||||
@@ -109,7 +109,7 @@ func ReadBioSequences(filenames ...string) (obiiter.IBioSequenceBatch, error) {
|
||||
|
||||
list_of_files, err := _ExpandListOfFiles(false, filenames...)
|
||||
if err != nil {
|
||||
return obiiter.NilIBioSequenceBatch, err
|
||||
return obiiter.NilIBioSequence, err
|
||||
}
|
||||
|
||||
switch CLIInputFormat() {
|
||||
@@ -140,7 +140,7 @@ func ReadBioSequences(filenames ...string) (obiiter.IBioSequenceBatch, error) {
|
||||
iterator, err = reader(list_of_files[0], opts...)
|
||||
|
||||
if err != nil {
|
||||
return obiiter.NilIBioSequenceBatch, err
|
||||
return obiiter.NilIBioSequence, err
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -8,10 +8,10 @@ import (
|
||||
"git.metabarcoding.org/lecasofts/go/obitools/pkg/obioptions"
|
||||
)
|
||||
|
||||
func WriteBioSequences(iterator obiiter.IBioSequenceBatch,
|
||||
terminalAction bool, filenames ...string) (obiiter.IBioSequenceBatch, error) {
|
||||
func WriteBioSequences(iterator obiiter.IBioSequence,
|
||||
terminalAction bool, filenames ...string) (obiiter.IBioSequence, error) {
|
||||
|
||||
var newIter obiiter.IBioSequenceBatch
|
||||
var newIter obiiter.IBioSequence
|
||||
|
||||
opts := make([]obiformats.WithOption, 0, 10)
|
||||
|
||||
@@ -62,12 +62,12 @@ func WriteBioSequences(iterator obiiter.IBioSequenceBatch,
|
||||
|
||||
if err != nil {
|
||||
log.Fatalf("Write file error: %v", err)
|
||||
return obiiter.NilIBioSequenceBatch, err
|
||||
return obiiter.NilIBioSequence, err
|
||||
}
|
||||
|
||||
if terminalAction {
|
||||
newIter.Recycle()
|
||||
return obiiter.NilIBioSequenceBatch, nil
|
||||
return obiiter.NilIBioSequence, nil
|
||||
}
|
||||
|
||||
return newIter, nil
|
||||
|
||||
Reference in New Issue
Block a user