Skip to content

Commit

Permalink
fix: issue go-ozzo#155
Browse files Browse the repository at this point in the history
  • Loading branch information
Thearas committed Dec 20, 2021
1 parent 34bd547 commit 887ba95
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 10 deletions.
4 changes: 2 additions & 2 deletions example_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import (
"fmt"
"regexp"

"github.com/go-ozzo/ozzo-validation/v4"
"github.com/go-ozzo/ozzo-validation/v4/is"
validation "github.com/Thearas/ozzo-validation/v4"
"github.com/Thearas/ozzo-validation/v4/is"
)

type Address struct {
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/go-ozzo/ozzo-validation/v4
module github.com/Thearas/ozzo-validation/v4

go 1.13

Expand Down
2 changes: 1 addition & 1 deletion is/rules.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import (
"regexp"
"unicode"

validation "github.com/Thearas/ozzo-validation/v4"
"github.com/asaskevich/govalidator"
validation "github.com/go-ozzo/ozzo-validation/v4"
)

var (
Expand Down
2 changes: 1 addition & 1 deletion is/rules_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"strings"
"testing"

"github.com/go-ozzo/ozzo-validation/v4"
validation "github.com/Thearas/ozzo-validation/v4"
"github.com/stretchr/testify/assert"
)

Expand Down
11 changes: 6 additions & 5 deletions util.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ import (
)

var (
bytesType = reflect.TypeOf([]byte(nil))
valuerType = reflect.TypeOf((*driver.Valuer)(nil)).Elem()
bytesType = reflect.TypeOf([]byte(nil))
// valuerType = reflect.TypeOf((*driver.Valuer)(nil)).Elem()
)

// EnsureString ensures the given value is a string.
Expand Down Expand Up @@ -148,9 +148,10 @@ func Indirect(value interface{}) (interface{}, bool) {
}
}

if rv.Type().Implements(valuerType) {
return indirectValuer(value.(driver.Valuer))
}
// TODO: https://github.com/go-ozzo/ozzo-validation/issues/155.
// if rv.Type().Implements(valuerType) {
// return indirectValuer(value.(driver.Valuer))
// }

return value, false
}
Expand Down

0 comments on commit 887ba95

Please sign in to comment.