mirror of
https://github.com/metabarcoding/obitools4.git
synced 2025-06-29 16:20:46 +00:00
Refactoring of the default values
This commit is contained in:
@ -2,6 +2,7 @@ package obiutils
|
||||
|
||||
import (
|
||||
"path"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
)
|
||||
|
||||
@ -21,3 +22,16 @@ func RemoveAllExt(p string) string {
|
||||
return p
|
||||
|
||||
}
|
||||
|
||||
func Basename(path string) string {
|
||||
filename := filepath.Base(path)
|
||||
ext := filepath.Ext(filename)
|
||||
|
||||
// Keep removing extensions until there are no more
|
||||
for ext != "" {
|
||||
filename = strings.TrimSuffix(filename, ext)
|
||||
ext = filepath.Ext(filename)
|
||||
}
|
||||
|
||||
return filename
|
||||
}
|
||||
|
Reference in New Issue
Block a user