mirror of
https://github.com/metabarcoding/obitools4.git
synced 2025-06-29 16:20:46 +00:00
Change the way sequence definition are managed. They are now when present stored as an attribute
Former-commit-id: 6e618377c05b42937d2eace3c9668390980ab68c
This commit is contained in:
@ -1,5 +1,17 @@
|
||||
package obiutils
|
||||
|
||||
import "fmt"
|
||||
|
||||
// InterfaceToString converts an interface value to a string.
|
||||
//
|
||||
// The function takes an interface{} value as a parameter and returns a string representation of that value.
|
||||
// It returns the string representation and an error if any occurred during the conversion process.
|
||||
func InterfaceToString(i interface{}) (val string, err error) {
|
||||
err = nil
|
||||
val = fmt.Sprintf("%v", i)
|
||||
return
|
||||
}
|
||||
|
||||
// CastableToInt checks if the given input can be casted to an integer.
|
||||
//
|
||||
// i: the value to check for castability.
|
||||
|
@ -4,7 +4,6 @@ import (
|
||||
"bufio"
|
||||
"bytes"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"io"
|
||||
"os"
|
||||
"reflect"
|
||||
@ -13,15 +12,6 @@ import (
|
||||
"github.com/barkimedes/go-deepcopy"
|
||||
)
|
||||
|
||||
// InterfaceToInt converts a interface{} to an integer value if possible.
|
||||
// If not a "NotAnInteger" error is returned via the err
|
||||
// return value and val is set to 0.
|
||||
func InterfaceToString(i interface{}) (val string, err error) {
|
||||
err = nil
|
||||
val = fmt.Sprintf("%v", i)
|
||||
return
|
||||
}
|
||||
|
||||
// NotAnInteger defines a new type of Error : "NotAnInteger"
|
||||
type NotAnInteger struct {
|
||||
message string
|
||||
|
Reference in New Issue
Block a user