• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

go-playground / validator / 20085577563 / 1
74%
v8: 100%

Build:
Build:
LAST BUILD BRANCH: #1519/feature/trx_addr-tag
DEFAULT BRANCH: v8
Ran 10 Dec 2025 02:48AM UTC
Files 34
Run time 1s
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

10 Dec 2025 02:47AM UTC coverage: 73.749%. Remained the same
20085577563.1

push

github

web-flow
`excluded_unless` bug fix (#1307)

## Fixes Or Enhances

The verbiage in the documentation for both `excluded_unless` and
`required_unless` is very similar. One would expect the opposite
behavior for each when using multiple values of the same field that is
being validated against.

For example:

This fails in all 3  cases in sample code
```go
package main

import (
	"fmt"
	"github.com/go-playground/validator/v10"
)


type TestStruct struct {
	Foo int
	Bar string `validate:"excluded_unless=Foo 1 Foo 2"`
}

func main() {

	validator := validator.New()

	testA := TestStruct{
		Foo: 1,
		Bar: "test",
	}
	testB := TestStruct{
		Foo: 2,
		Bar: "test",
	}
	testC := TestStruct{
		Foo: 3,
		Bar: "test",
	}

	err := validator.Struct(testA)
	if err != nil {
		fmt.Println(err.Error())
	}

	err = validator.Struct(testB)
	if err != nil {
		fmt.Println(err.Error())
	}

	err = validator.Struct(testC)
	if err != nil {
		fmt.Println(err.Error())
	}

}
```

However, the equivilant opposite of this only fails in TestC

```go
type TestStruct struct {
	Foo int
	Bar string `validate:"required_unless=Foo 1 Foo 2"`
}

func main() {

	validator := validator.New()

	testA := TestStruct{
		Foo: 1,
	}
	testB := TestStruct{
		Foo: 2,
	}
	
	err := validator.Struct(testA)
	if err != nil {
		fmt.Println(err.Error())
	}

	err = validator.Struct(testB)
	if err != nil {
		fmt.Println(err.Error())
	}

}
```

resolves #1306

14387 of 19508 relevant lines covered (73.75%)

80.4 hits per line

Source Files on job 20085577563.1
  • Tree
  • List 34
  • Changed 1
  • Source Changed 0
  • Coverage Changed 1
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Build 20085577563
  • afce000d on github
  • Prev Job for on master (#19948930277.1)
  • Next Job for on master (#20287187071.1)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc