MCPcopy Create free account
hub / github.com/Scalingo/cli / validateHoursBeforeDelete

Function validateHoursBeforeDelete

cmd/integration_link.go:551–566  ·  view source on GitHub ↗
(ctx context.Context)

Source from the content-addressed store, hash-verified

549}
550
551func validateHoursBeforeDelete(ctx context.Context) survey.Validator {
552 return func(ans any) error {
553 str, ok := ans.(string)
554 if !ok {
555 return errors.New(ctx, "must be a string")
556 }
557 i, err := strconv.ParseInt(str, 10, 32)
558 if err != nil {
559 return errors.Wrapf(ctx, err, "error parsing hours")
560 }
561 if i < 0 {
562 return errors.New(ctx, "must be positive")
563 }
564 return nil
565 }
566}
567
568func askForConfirmationToAllowReviewAppsFromForks(ctx context.Context, prompt string) (bool, error) {
569 fmt.Println()

Callers 1

interactiveCreateFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected