packagemainimport"fmt"funcmain(){ifage:=getMyAge();age>14{fmt.Println("You're ok to sign up.")}elseifapprove:=getParentApprove();age>=12&&approve{fmt.Println("Your parent approved you to sign up.")}elseifage<12{fmt.Println("You need to be at least 12-years-old to sign up.")}else{fmt.Println("Your parent didn't approved you to sign up.")}}funcgetMyAge()int{return12}funcgetParentApprove()bool{returnfalse}
$ go build
$ ./go_else_if_init
Your parent didn't approved you to sign up.