Skip to content

[Bug]: e164 validation allows phone codes starting with +0 #1475

@sashayakovtseva

Description

@sashayakovtseva

What happened?

Expected: validation error, phone codes starting with +0 are not allowed.
Actual: no error.

Version

v10.28.0

Example Code

package main

import (
	"fmt"

	validator "github.com/go-playground/validator/v10"
)

func main() {
	v := validator.New(validator.WithRequiredStructEnabled())
	err := v.Var("+0123456789", "e164")
	fmt.Println(err)
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions