Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from
Feb 12, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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