mirror of
https://github.com/metabarcoding/obitools4.git
synced 2025-06-29 16:20:46 +00:00
Adds doc and unit tests
Former-commit-id: 6f60f97947111b4fc65cc0e72d18770ba6094088
This commit is contained in:
@ -5,12 +5,19 @@ import (
|
||||
"strings"
|
||||
)
|
||||
|
||||
// RemoveAllExt removes all file extensions from the given path.
|
||||
//
|
||||
// Parameters:
|
||||
// - p: the path to remove file extensions from (string).
|
||||
//
|
||||
// Returns:
|
||||
// - The path without any file extensions (string).
|
||||
func RemoveAllExt(p string) string {
|
||||
|
||||
|
||||
for ext := path.Ext(p); len(ext) > 0; ext = path.Ext(p) {
|
||||
p = strings.TrimSuffix(p, ext)
|
||||
p = strings.TrimSuffix(p, ext)
|
||||
}
|
||||
|
||||
|
||||
return p
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user