Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p><code>I'm guessing int's are allowed less bits than constants?</code></p> <p>yes, Numeric constants are high-precision values. An <code>int</code> in any language doesn't have near the precision of other numeric types.</p> <p><code>Which language is alluded to?</code></p> <p>No clue but it is backwards from C and Java where <code>( )</code> is required and <code>{ }</code> is optional.</p> <p><code>Why do we need the word type and the word struct? What was I supposed to expect?</code></p> <p>If you're familiar with C, then it does what you'd expect.</p> <p><code>Why implicit zeroes in the constructor?</code></p> <p>It's not implicit in the contructor only. Look at this</p> <pre><code>var i int fmt.Println(i) </code></pre> <p>This prints out <code>0</code>. This is similar to something like java where primitive types have an implicit default value. booleans are false, integers are zero, etc.</p> <p><code>Make? Are there constructors? What's the difference between new and make?</code></p> <p><code>make</code> accepts additional parameters for initializing the size of an array, slice, or map. <code>new</code> on the other hand just returns a pointer to a type.</p> <pre><code>type Data struct {} // both d1 and d2 are pointers d1 := new(Data) d2 := &amp;Data{} </code></pre> <p>As for <code>are there constructors?</code>, only if you make and reference them. This how one normally implements a constructor in Go.</p> <pre><code>type Data struct {} func NewData() *Data { return new(Data) } </code></pre> <p><code>What's the %v formatter stand for? Value?</code></p> <p>Yep</p> <p><code>I return error values when a function fails? ... Why would they design it like that?</code></p> <p>I felt the same way at first. My opinion has changed though. You can ignore errors from the std library if you like and not bother with it yourself, but once I had a handle on it, I personally find I have better (and more readable) error checking.</p> <p>What I can say is when I was doing it wrong, it felt like repetitive error handling that felt unnecessary. When I finally started doing it right... well, what I just said above.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload