Removed useless else statements

This commit is contained in:
foglar 2024-02-22 19:31:23 +01:00
parent fa7479ccf3
commit 714bc7cfc5
2 changed files with 7 additions and 8 deletions

View File

@ -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 {

View File

@ -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