From e0c36d3efd253407808615d2b0ad522bf13526bf Mon Sep 17 00:00:00 2001 From: tsukasa inoue Date: Tue, 10 Sep 2024 09:18:25 +0900 Subject: [PATCH] clean: update variable name --- lib/options.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/options.go b/lib/options.go index a4b91fd769d..e4f3a2d6929 100644 --- a/lib/options.go +++ b/lib/options.go @@ -520,7 +520,7 @@ func (o Options) Apply(opts Options) Options { func (o Options) Validate() []error { // TODO: validate all of the other options... that we should have already been validating... // TODO: maybe integrate an external validation lib: https://github.com/avelino/awesome-go#validation - var errorsSlice []error + var validationErrors []error if o.ExecutionSegmentSequence != nil { var segmentFound bool for _, segment := range *o.ExecutionSegmentSequence { @@ -530,18 +530,18 @@ func (o Options) Validate() []error { } } if !segmentFound { - errorsSlice = append(errorsSlice, + validationErrors = append(validationErrors, fmt.Errorf("provided segment %s can't be found in sequence %s", o.ExecutionSegment, o.ExecutionSegmentSequence)) } } - errorsSlice = append(errorsSlice, o.Scenarios.Validate()...) + validationErrors = append(validationErrors, o.Scenarios.Validate()...) // Duration if o.SetupTimeout.Valid && o.SetupTimeout.Duration <= 0 { - errorsSlice = append(errorsSlice, errors.New("setupTimeout must be positive")) + validationErrors = append(validationErrors, errors.New("setupTimeout must be positive")) } - return errorsSlice + return validationErrors } // ForEachSpecified enumerates all struct fields and calls the supplied function with each