MCPcopy Create free account
hub / github.com/devnullvoid/pvetui / parseDuration

Function parseDuration

internal/ui/plugins/ansible/plugin.go:2680–2695  ·  view source on GitHub ↗
(value string, fallback time.Duration)

Source from the content-addressed store, hash-verified

2678}
2679
2680func parseDuration(value string, fallback time.Duration) (time.Duration, error) {
2681 trimmed := strings.TrimSpace(value)
2682 if trimmed == "" {
2683 return fallback, nil
2684 }
2685
2686 d, err := time.ParseDuration(trimmed)
2687 if err != nil {
2688 return 0, err
2689 }
2690 if d <= 0 {
2691 return 0, fmt.Errorf("duration must be positive")
2692 }
2693
2694 return d, nil
2695}
2696
2697func buildSetupGuide(inventory coreansible.InventoryResult) string {
2698 var b strings.Builder

Callers 4

showBootstrapRunFormMethod · 0.85
showAdhocFormMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected