1
0
mirror of https://github.com/MontFerret/ferret.git synced 2025-08-15 20:02:56 +02:00

rename functions Parse<Type>P -> MustParse<Type>. while dined (#231)

This commit is contained in:
3timeslazy
2019-02-13 02:01:49 +03:00
committed by Tim Voronov
parent 84fde8c109
commit b3bcbda3b9
5 changed files with 7 additions and 6 deletions

View File

@@ -45,7 +45,7 @@ func ParseBoolean(input interface{}) (Boolean, error) {
return False, core.Error(core.ErrInvalidType, "expected 'bool'") return False, core.Error(core.ErrInvalidType, "expected 'bool'")
} }
func ParseBooleanP(input interface{}) Boolean { func MustParseBoolean(input interface{}) Boolean {
res, err := ParseBoolean(input) res, err := ParseBoolean(input)
if err != nil { if err != nil {

View File

@@ -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) dt, err := ParseDateTime(input)
if err != nil { if err != nil {

View File

@@ -4,10 +4,11 @@ import (
"encoding/binary" "encoding/binary"
"encoding/json" "encoding/json"
"fmt" "fmt"
"github.com/MontFerret/ferret/pkg/runtime/core"
"hash/fnv" "hash/fnv"
"math" "math"
"strconv" "strconv"
"github.com/MontFerret/ferret/pkg/runtime/core"
) )
type Float float64 type Float float64
@@ -51,7 +52,7 @@ func ParseFloat(input interface{}) (Float, error) {
return ZeroFloat, core.Error(core.ErrInvalidType, "expected 'float'") return ZeroFloat, core.Error(core.ErrInvalidType, "expected 'float'")
} }
func ParseFloatP(input interface{}) Float { func MustParseFloat(input interface{}) Float {
res, err := ParseFloat(input) res, err := ParseFloat(input)
if err != nil { if err != nil {

View File

@@ -50,7 +50,7 @@ func ParseInt(input interface{}) (Int, error) {
} }
} }
func ParseIntP(input interface{}) Int { func MustParseInt(input interface{}) Int {
res, err := ParseInt(input) res, err := ParseInt(input)
if err != nil { if err != nil {

View File

@@ -54,7 +54,7 @@ func ParseString(input interface{}) (String, error) {
return EmptyString, core.Error(core.ErrInvalidType, "expected 'string'") return EmptyString, core.Error(core.ErrInvalidType, "expected 'string'")
} }
func ParseStringP(input interface{}) String { func MustParseString(input interface{}) String {
res, err := ParseString(input) res, err := ParseString(input)
if err != nil { if err != nil {