Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<ul> <li><p><a href="http://tour.golang.org/#15" rel="noreferrer">#15</a>:</p> <blockquote> <p>I'm guessing int's are allowed less bits than constants?</p> </blockquote> <p>Yes, exactly. According to the spec, <a href="http://golang.org/ref/spec#Constants" rel="noreferrer">"numeric constants represent values of arbitrary precision and do not overflow"</a>, whereas <a href="http://golang.org/ref/spec#Numeric_types" rel="noreferrer">type <code>int</code> has either 32 or 64 bits</a>.</p></li> <li><p><a href="http://tour.golang.org/#21" rel="noreferrer">#21</a>:</p> <blockquote> <p>Which language is alluded to?</p> </blockquote> <p>None; it's alluding to <a href="http://tour.golang.org/#16" rel="noreferrer">#16</a>, which says the same thing, in the same words, about <code>for</code>-loops.</p></li> <li><p><a href="http://tour.golang.org/#25" rel="noreferrer">#25</a> :</p> <p><code>a type declaration does what you'd expect</code> is a little unfortunate, I agree (as it assumes too much on what a reader could expect...) but it means you're defining a struct (with the <code>struct</code> keyword) and binding the type name "Vertex" to it, with the <code>type Vertex</code> part (see <a href="http://golang.org/ref/spec#Type_declarations" rel="noreferrer">http://golang.org/ref/spec#Type_declarations</a>)</p></li> <li><p><a href="http://tour.golang.org/#28" rel="noreferrer">#28</a>:</p> <p>the fact that uninitialized structs are zeroed is really really useful in many cases (many standard structs like buffers use it also)</p> <p>It's not implicit in the contructor only. Look at this</p> <p><code>var i int; fmt.Println(i)</code></p> <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. <a href="http://golang.org/ref/spec#The_zero_value" rel="noreferrer">The spec on zero values.</a></p></li> <li><p><a href="http://tour.golang.org/#30" rel="noreferrer">#30</a>:</p> <p><code>new</code> allocates memory and returns a pointer to it, while <code>make</code> is a special function used only for Slices, maps and channels. See <a href="http://golang.org/doc/effective_go.html#allocation_new" rel="noreferrer">http://golang.org/doc/effective_go.html#allocation_new</a> for a more in-depth explanation of <code>make</code> vs <code>new</code></p></li> <li><p><a href="http://tour.golang.org/#33" rel="noreferrer">#33</a>:</p> <p><code>delete</code>, like <code>append</code> or <code>copy</code> is one of the basic operators of the language. See the full list of them at: <a href="http://golang.org/ref/spec#Predeclared_identifiers" rel="noreferrer">http://golang.org/ref/spec#Predeclared_identifiers</a></p></li> <li><p><a href="http://tour.golang.org/#36" rel="noreferrer">#36</a>:</p> <p>Yes, <code>%v</code> stands for "value". See <a href="http://golang.org/pkg/fmt/" rel="noreferrer">http://golang.org/pkg/fmt/</a></p></li> <li><p><a href="http://tour.golang.org/#47" rel="noreferrer">#47</a>:</p></li> </ul> <p>try with this:</p> <pre><code>func Pic(dx, dy int) [][]uint8 { image := make([][]uint8, dy) // dy, not 10 for x := range image { image[x] = make([]uint8, dx) // dx, not 10 for y := range image[x] { image[x][y] = uint8(x*y) //let's try one of the mentioned // "interesting functions" } } return image } </code></pre> <ul> <li><p><a href="http://tour.golang.org/#59" rel="noreferrer">#59</a>:</p> <blockquote> <p>The language's design and conventions encourage you to explicitly check for errors where they occur (as distinct from the convention in other languages of throwing exceptions and sometimes catching them). In some cases this makes Go code verbose, but fortunately there are some techniques you can use to minimize repetitive error handling.</p> </blockquote> <p>(quoted from <a href="http://blog.golang.org/2011/07/error-handling-and-go.html" rel="noreferrer">Error handling and Go</a> )</p></li> </ul>
 

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