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

Function parseOptionalPositiveInt

internal/ui/plugins/ansible/plugin.go:958–968  ·  view source on GitHub ↗
(raw string)

Source from the content-addressed store, hash-verified

956}
957
958func parseOptionalPositiveInt(raw string) (int, error) {
959 trimmed := strings.TrimSpace(raw)
960 if trimmed == "" {
961 return 0, nil
962 }
963 value, err := strconv.Atoi(trimmed)
964 if err != nil || value <= 0 {
965 return 0, fmt.Errorf("must be a positive integer or blank")
966 }
967 return value, nil
968}
969
970func buildLimitPickerOptions(inventory coreansible.InventoryResult) ([]string, []string) {
971 groupSet := make(map[string]struct{})

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected