Skip to content

Commit

Permalink
rename functions Parse<Type>P -> MustParse<Type>. while dined (#231)
Browse files Browse the repository at this point in the history
  • Loading branch information
3timeslazy authored and ziflex committed Feb 12, 2019
1 parent 84fde8c commit b3bcbda
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion pkg/runtime/values/boolean.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion pkg/runtime/values/date_time.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
5 changes: 3 additions & 2 deletions pkg/runtime/values/float.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion pkg/runtime/values/int.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion pkg/runtime/values/string.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit b3bcbda

Please sign in to comment.