title: How to do one-liner if else statement?
body: <p>Please see <a href="https://golangdocs.com/ternary-operator-in-golang" rel="noreferrer">https://golangdocs.com/ternary-operator-in-golang</a> as pointed by @accdias (see comments)</p>
  <p>Can I write a simple if-else statement with variable assignment in go (golang) as I would do in php? For example:</p>
  <pre><code>$var = ( $a &gt; $b )? $a: $b;
  </code></pre>
  <p>Currently I have to use the following:</p>
  <pre><code>var c int
  if a &gt; b {
      c = a
  } else {
      c = b
  }
  </code></pre>
  <p>Sorry I cannot remember the name if this control statement and I couldn't find the info in-site or through google search. :/</p>