Forgot a function.

This commit is contained in:
Sacha Ligthert 2025-01-28 18:26:44 +01:00
parent b83d6bdde4
commit 2461f5b417
2 changed files with 14 additions and 13 deletions

View File

@ -6,19 +6,6 @@ import (
"os"
)
// Validate if the char provided is 0-9
func (flags *Flags) validChar(char rune) (valid bool) {
decvals := [10]int{48, 49, 50, 51, 52, 53, 54, 55, 56, 57}
for _, value := range decvals {
if char == rune(value) {
valid = true
}
}
return
}
// Print help information for the end-user
func (flags *Flags) printUsage() {
fmt.Fprintf(flag.CommandLine.Output(), "Usage of %s:\n", os.Args[0])

14
flags/validChar.go Normal file
View File

@ -0,0 +1,14 @@
package flags
// Validate if the char provided is 0-9
func (flags *Flags) validChar(char rune) (valid bool) {
decvals := [10]int{48, 49, 50, 51, 52, 53, 54, 55, 56, 57}
for _, value := range decvals {
if char == rune(value) {
valid = true
}
}
return
}