I'm relatively new to Go, and in a bid to catch on quickly I tried rewriting some of my JavaScript(NodeJS) code in Go. Recently I hit sort of a stumbling block, where I found out that Go doesn't have ternary operators. For example in JavaScript I could do this:
const pageNumber: number = query.pageNumber ? parseInt(query.pageNumber, 10): 1;
query here represents Req.query
But I found out that I couldn't do the same with Go, I had to write an if-else statement. I'd just like to know what the reason is as to why this doesn't exist in Go world (of if there's some design principle as to why this is so)