mirror of
https://github.com/metabarcoding/obitools4.git
synced 2025-06-29 16:20:46 +00:00
adds the subspc function to the gval language
This commit is contained in:
@ -3,6 +3,7 @@ package obieval
|
||||
import (
|
||||
"fmt"
|
||||
"log"
|
||||
"strings"
|
||||
|
||||
"git.metabarcoding.org/lecasofts/go/obitools/pkg/goutils"
|
||||
"github.com/PaesslerAG/gval"
|
||||
@ -146,6 +147,10 @@ var OBILang = gval.NewLanguage(
|
||||
text := fmt.Sprintf(args[0].(string), args[1:]...)
|
||||
return text, nil
|
||||
}),
|
||||
gval.Function("subspc", func(args ...interface{}) (interface{}, error) {
|
||||
text := strings.ReplaceAll(args[0].(string), " ", "_")
|
||||
return text, nil
|
||||
}),
|
||||
gval.Function("int", func(args ...interface{}) (interface{}, error) {
|
||||
val, err := goutils.InterfaceToInt(args[0])
|
||||
|
||||
|
Reference in New Issue
Block a user