// CHANGED FROM SECOND PART TO IF-ELSE TO HANDLE EMPTY USER INPUT CASE
fmt.Print("Time Start in Zulu (HHMMSS): ")
fmt.Scanln(&timeStart)
if timeStart != "" {
test := timeStart
test1, _ := strconv.Atoi(test)
} else {
test := 000000
test1, _ := strconv.Atoi(test)
}
// WORKING SECOND PART (FOR REFERENCE)
fmt.Print("Time End in Zulu (HHMMSS): ")
fmt.Scanln(&timeEnd)
test3 := timeEnd
test4, _ := strconv.Atoi(test3)
// FOR LOOP THAT IS EVALUATED AFTER TAKING THE USER INPUT // WAS ABLE TO SEE TEST1 BEFORE
for x := test1; x <= test4; x++ {
Error: Declared and not used
I am attempting to take user input and pass this to a for loop later in the program. Without the if-else statement, it is fine, but as soon as it goes into the if-else statement, it magically can't see it anymore. Any idea what I am missing? I know the variable names can be changed, just POC for now lol