vá se
func sqrt(x float64) string {
if x < 0 {
return sqrt(-x) + "i"
}
return fmt.Sprint(math.Sqrt(x))
}
func main() {
fmt.Println(sqrt(2), sqrt(-4))
}
DevLorenzo
func sqrt(x float64) string {
if x < 0 {
return sqrt(-x) + "i"
}
return fmt.Sprint(math.Sqrt(x))
}
func main() {
fmt.Println(sqrt(2), sqrt(-4))
}
package main
import "fmt"
func main() {
name := "Manager"
if name == "Manager" {
fmt.Println("This is the Manager")
} else {
fmt.Println("This is not the manager")
}
}
if _, err := doThing(); err != nil {
fmt.Println("Uh oh")
}
if test_condition {
// code
}