mirror of
https://github.com/foomo/fender.git
synced 2026-06-28 22:00:03 +00:00
15 lines
173 B
Go
15 lines
173 B
Go
package rule
|
|
|
|
import (
|
|
"context"
|
|
"reflect"
|
|
)
|
|
|
|
func Optional[T any](ctx context.Context, v T) error {
|
|
if reflect.ValueOf(v).IsZero() {
|
|
return ErrBreak
|
|
}
|
|
|
|
return nil
|
|
}
|