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

chore: padronizei o uso de any no arquivo validator.go do pacote pkg/… #108

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
4 changes: 2 additions & 2 deletions pkg/base/validator/validator.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ func registerUUIDCustomType() {
//
// It takes an array of strings as input parameters and returns an interface{} and an error.
func registerIsoDateCustomType() {
instance.formDecoder.RegisterCustomTypeFunc(func(vals []string) (interface{}, error) {
instance.formDecoder.RegisterCustomTypeFunc(func(vals []string) (any, error) {
return types.ParseIsoDate(vals[0])
}, types.IsoDate{})
}
Expand All @@ -63,7 +63,7 @@ func registerIsoDateCustomType() {
//
// It takes an array of strings as input parameters and returns an interface{} and an error.
func registerIsoTimeCustomType() {
instance.formDecoder.RegisterCustomTypeFunc(func(vals []string) (interface{}, error) {
instance.formDecoder.RegisterCustomTypeFunc(func(vals []string) (any, error) {
return types.ParseIsoTime(vals[0])
}, types.IsoTime{})
}
Expand Down
9 changes: 4 additions & 5 deletions pkg/di/tests/variadic_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,19 @@ import (
"github.com/stretchr/testify/assert"
)

func newInt2() int{
func newInt2() int {
return 2
}

func newInt1() int{
func newInt1() int {
return 1
}

func newStringV() string{
func newStringV() string {
return "stringv"
}

func NewV(a string, s ...int)string{
func NewV(a string, s ...int) string {
fmt.Println("recebi: ", len(s), " dependencias ")
return "s"
}
Expand All @@ -32,4 +32,3 @@ func Test_variadic(t *testing.T) {
a.AddDependencies(funcs)
assert.NotPanics(t, func() { a.StartApp(NewV) })
}