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
0 for Principal Amount
- Input
£0 for 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 {
Describe the bug
Inputting symbols and placeholders like
£,$and%bypasses validation rulesTo Reproduce
Steps to reproduce the behavior:
10for Principal Amount£0for Principal AmountExpected behavior
First input triggers error and
goto paworks, second input triggers error message but doesntgoto pa, instead skips to else statement