Add function "AddToCommandFlags" to FlagValidator interface
All checks were successful
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 33s
All checks were successful
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 33s
Signed-off-by: Jan Tytgat <jan.tytgat@corelayer.eu>
This commit is contained in:
@ -3,12 +3,15 @@ package flagzog
|
||||
import (
|
||||
"context"
|
||||
"log/slog"
|
||||
|
||||
"github.com/spf13/pflag"
|
||||
)
|
||||
|
||||
type FlagValidator interface {
|
||||
Name() string
|
||||
Validate() ([]string, error)
|
||||
Usage() string
|
||||
AddToCommandFlags(flagset *pflag.FlagSet, shorthand string, value interface{})
|
||||
}
|
||||
|
||||
func ValidateFlags(ctx context.Context, logger *slog.Logger, flags []FlagValidator) ([]string, error) {
|
||||
|
Reference in New Issue
Block a user