go-ozzo / ozzo-validation

An idiomatic Go (golang) validation package. Supports configurable and extensible validation rules (validators) using normal language constructs instead of error-prone struct tags.
MIT License
3.73k stars 224 forks source link

Added time.Time isEmpty check #48

Closed kfreiman closed 6 years ago

kfreiman commented 6 years ago
import "time"

type Person struct {
    Birth time.Time
}

func (p Person) Validate() error {
    return validation.ValidateStruct(&p,
        validation.Field(&p.Birth, validation.Required), // Birth cannot be empty
    )
}
coveralls commented 6 years ago

Coverage Status

Coverage remained the same at 100.0% when pulling 69e61f809cef4927253043a51036ce092fdc023f on kfreiman:master into 2c68ddd4ffc17941d8e940cb1264f68e1d8f0394 on go-ozzo:master.

ghost commented 6 years ago

@kfreiman Do you know how to contact the author of this repo?

I've got a pending PR as well: https://github.com/go-ozzo/ozzo-validation/pull/46

kfreiman commented 6 years ago

It seems the best way to contact with @qiangxue about OpenSource stuf is the issues and PRs. Until he respond we should use own forks if new features are needed. If author will decide do not maintain the project, he will ask community to maintain project instead of himself.

qiangxue commented 6 years ago

Thanks!