Removed useless else statements
This commit is contained in:
parent
fa7479ccf3
commit
714bc7cfc5
@ -61,9 +61,10 @@ func inputPort() string {
|
|||||||
|
|
||||||
if isPort(s_port) == true {
|
if isPort(s_port) == true {
|
||||||
break
|
break
|
||||||
} else {
|
|
||||||
fmt.Println("Error - Invalid Port")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fmt.Println("Error - Invalid Port")
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return s_port
|
return s_port
|
||||||
@ -78,9 +79,8 @@ func inputBaudrate() (int, error) {
|
|||||||
|
|
||||||
if isBaud(s_baud) == true {
|
if isBaud(s_baud) == true {
|
||||||
break
|
break
|
||||||
} else {
|
|
||||||
fmt.Println("Error - Invalid Baudrate")
|
|
||||||
}
|
}
|
||||||
|
fmt.Println("Error - Invalid Baudrate")
|
||||||
}
|
}
|
||||||
|
|
||||||
return strconv.Atoi(s_baud)
|
return strconv.Atoi(s_baud)
|
||||||
@ -90,9 +90,9 @@ func isPort(port string) bool {
|
|||||||
_, err := os.Stat(port)
|
_, err := os.Stat(port)
|
||||||
if !os.IsNotExist(err) {
|
if !os.IsNotExist(err) {
|
||||||
return true
|
return true
|
||||||
} else {
|
|
||||||
return false
|
|
||||||
}
|
}
|
||||||
|
return false
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func isBaud(baud string) bool {
|
func isBaud(baud string) bool {
|
||||||
|
|||||||
@ -23,9 +23,8 @@ func portInput() string {
|
|||||||
_, err := os.Stat(port)
|
_, err := os.Stat(port)
|
||||||
if !os.IsNotExist(err) {
|
if !os.IsNotExist(err) {
|
||||||
break
|
break
|
||||||
} else {
|
|
||||||
fmt.Println("Invalid port")
|
|
||||||
}
|
}
|
||||||
|
fmt.Println("Invalid port")
|
||||||
}
|
}
|
||||||
|
|
||||||
return port
|
return port
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user