Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8568727
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T18:10:30+00:00 2026-06-11T18:10:30+00:00

There are a few points in the tutorial that sort of leave you on

  • 0

There are a few points in the tutorial that sort of leave you on your own without a clue or link if you’re not in the know I guess. So I’m sorry about the length of these:

http://tour.golang.org/#15

Try printing needInt(Big) too

I’m guessing ints are allowed less bits than constants?


http://tour.golang.org/#21

the { } are required.

(Sound familiar?)

Which language is alluded to?


http://tour.golang.org/#25

(And a type declaration does what you'd expect.)

Why do we need the word type and the word struct? What was I supposed to expect?


http://tour.golang.org/#28

Why implicit zeroes in the constructor? This sounds like a dangerous design choice by Go. Is there a PEP or anything beyond http://golang.org/doc/go_faq.html on this?


http://tour.golang.org/#30

Make? Are there constructors? What’s the difference between new and make?


http://tour.golang.org/#33

Where did delete come from? I didn’t import it.


http://tour.golang.org/#36

What’s the %v formatter stand for? Value?


http://tour.golang.org/#47

panic: runtime error: index out of range

goroutine 1 [running]:
tour/pic.Show(0x400c00, 0x40ca61)
    go/src/pkg/tour/pic/pic.go:24 +0xd4
main.main()
    /tmpfs/gosandbox-15c0e483_5433f2dc_ff6f028f_248fd0a7_d7c2d35b/prog.go:14 +0x25

I guess I broke go somehow….

package main

import "tour/pic"

func Pic(dx, dy int) [][]uint8 {
    image := make([][]uint8, 10)
    for i := range image {
        image[i] = make([]uint8, 10)
    }
    return image
}

func main() {
    pic.Show(Pic)
}

http://tour.golang.org/#59

I return error values when a function fails? I have to qualify every single function call with an error check? The flow of the program is uninterrupted when I write crazy code? E.g. Copy(only_backup, elsewhere);Delete(only_backup) and Copy fails….

Why would they design it like that?


  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T18:10:31+00:00Added an answer on June 11, 2026 at 6:10 pm
    • #15:

      I’m guessing int’s are allowed less bits than constants?

      Yes, exactly. According to the spec, “numeric constants represent values of arbitrary precision and do not overflow”, whereas type int has either 32 or 64 bits.

    • #21:

      Which language is alluded to?

      None; it’s alluding to #16, which says the same thing, in the same words, about for-loops.

    • #25 :

      a type declaration does what you'd expect 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 struct keyword) and binding the type name “Vertex” to it, with the type Vertex part (see http://golang.org/ref/spec#Type_declarations)

    • #28:

      the fact that uninitialized structs are zeroed is really really useful in many cases (many standard structs like buffers use it also)

      It’s not implicit in the contructor only. Look at this

      var i int; fmt.Println(i)

      This prints out 0. This is similar to something like java where primitive types have an implicit default value. booleans are false, integers are zero, etc. The spec on zero values.

    • #30:

      new allocates memory and returns a pointer to it, while make is a special function used only for Slices, maps and channels.
      See http://golang.org/doc/effective_go.html#allocation_new for a more in-depth explanation of make vs new

    • #33:

      delete, like append or copy is one of the basic operators of the language. See the full list of them at: http://golang.org/ref/spec#Predeclared_identifiers

    • #36:

      Yes, %v stands for “value”. See http://golang.org/pkg/fmt/

    • #47:

    try with this:

    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
    }
    
    • #59:

      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.

      (quoted from Error handling and Go )

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I know that there are a few questions like this on SOF, but I
I know how to use locks in my app, but there still few things
I have an application that's locked down using forms authentication. There are few nightly
There are a few windows service projects in our codebase that follow this model,
I know there are a few questions floating around here on the subject, but
in my page there are few hidden field which are filled with the correct
It looks like there a few working solutions for using custom true type fonts
I have a webpage where there are few text fields to be filled up
I'm converting an old VB form to .NET, and there a few Buttons which
There are a few examples on unobtrusive events for pure JS. Most of questions

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.