Skip to content

Commit

Permalink
update error messages
Browse files Browse the repository at this point in the history
  • Loading branch information
miladrahimi committed Aug 20, 2021
1 parent 9d7830e commit 31a3a44
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions cast.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Package cast is a lightweight casting library for Go projects.
// Package cast is a lightweight casting library.
package cast

import (
Expand Down Expand Up @@ -27,9 +27,9 @@ const (
String = "string"
)

// FromString casts from a string variable to the given type
// FromString casts a string value to the given type.
func FromString(value string, targetType string) (interface{}, error) {
message := "cast: cannot cast value `%v` to type `%v`"
message := "cast: cannot cast `%v` to type `%v`"

switch targetType {
case Int:
Expand Down
2 changes: 1 addition & 1 deletion cast_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
)

func TestFromString(t *testing.T) {
message := "cast: cannot cast value `%v` to type `%v`"
message := "cast: cannot cast `%v` to type `%v`"

// string

Expand Down

0 comments on commit 31a3a44

Please sign in to comment.