mirror of
https://github.com/MontFerret/ferret.git
synced 2025-02-21 19:50:09 +02:00
rename functions Parse<Type>P -> MustParse<Type>. while dined (#231)
This commit is contained in:
parent
84fde8c109
commit
b3bcbda3b9
@ -45,7 +45,7 @@ func ParseBoolean(input interface{}) (Boolean, error) {
|
||||
return False, core.Error(core.ErrInvalidType, "expected 'bool'")
|
||||
}
|
||||
|
||||
func ParseBooleanP(input interface{}) Boolean {
|
||||
func MustParseBoolean(input interface{}) Boolean {
|
||||
res, err := ParseBoolean(input)
|
||||
|
||||
if err != nil {
|
||||
|
@ -44,7 +44,7 @@ func ParseDateTimeWith(input interface{}, layout string) (DateTime, error) {
|
||||
}
|
||||
}
|
||||
|
||||
func ParseDateTimeP(input interface{}) DateTime {
|
||||
func MustParseDateTime(input interface{}) DateTime {
|
||||
dt, err := ParseDateTime(input)
|
||||
|
||||
if err != nil {
|
||||
|
@ -4,10 +4,11 @@ import (
|
||||
"encoding/binary"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"github.com/MontFerret/ferret/pkg/runtime/core"
|
||||
"hash/fnv"
|
||||
"math"
|
||||
"strconv"
|
||||
|
||||
"github.com/MontFerret/ferret/pkg/runtime/core"
|
||||
)
|
||||
|
||||
type Float float64
|
||||
@ -51,7 +52,7 @@ func ParseFloat(input interface{}) (Float, error) {
|
||||
return ZeroFloat, core.Error(core.ErrInvalidType, "expected 'float'")
|
||||
}
|
||||
|
||||
func ParseFloatP(input interface{}) Float {
|
||||
func MustParseFloat(input interface{}) Float {
|
||||
res, err := ParseFloat(input)
|
||||
|
||||
if err != nil {
|
||||
|
@ -50,7 +50,7 @@ func ParseInt(input interface{}) (Int, error) {
|
||||
}
|
||||
}
|
||||
|
||||
func ParseIntP(input interface{}) Int {
|
||||
func MustParseInt(input interface{}) Int {
|
||||
res, err := ParseInt(input)
|
||||
|
||||
if err != nil {
|
||||
|
@ -54,7 +54,7 @@ func ParseString(input interface{}) (String, error) {
|
||||
return EmptyString, core.Error(core.ErrInvalidType, "expected 'string'")
|
||||
}
|
||||
|
||||
func ParseStringP(input interface{}) String {
|
||||
func MustParseString(input interface{}) String {
|
||||
res, err := ParseString(input)
|
||||
|
||||
if err != nil {
|
||||
|
Loading…
x
Reference in New Issue
Block a user