-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
Describe the bug
Inputting symbols and placeholders like £ , $ and % bypasses validation rules
To Reproduce
Steps to reproduce the behavior:
- Open cic.go and choose choice
1 - Input
0for Principal Amount - Input
£0for Principal Amount
Expected behavior
First input triggers error and goto pa works, second input triggers error message but doesnt goto pa, instead skips to else statement
func calcFA() {
var p float64
var s string
var n float64
var r float64
pa:
fmt.Print("Enter a Principal Amount(£): ")
fmt.Scanf("%f\n", &p)
if !(p > 0) {
fmt.Println("ERROR: you did not enter a number greater than zero, or included a symbol")
goto pa
} else {
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels