Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tour: figure out how to make pic.Show interact well with debug prints #14206

Open
doublek opened this issue Feb 3, 2016 · 4 comments
Open

tour: figure out how to make pic.Show interact well with debug prints #14206

doublek opened this issue Feb 3, 2016 · 4 comments

Comments

@doublek
Copy link

doublek commented Feb 3, 2016

Context: https://tour.golang.org/moretypes/15

Running the slices exercise doesn't display bluescale image. Instead it displays the slices of slices returned by Pic and as the last line prints "IMAGE: ".

@bradfitz bradfitz added this to the Unreleased milestone Feb 3, 2016
@adg
Copy link
Contributor

adg commented Feb 4, 2016

Are you able to provide a sample program that reproduces this issue? My trivial solution seems to work ok:

package main

import "golang.org/x/tour/pic"

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

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

@doublek
Copy link
Author

doublek commented Feb 10, 2016

I tried running my bit of code again, it turned out that I was debug printing some intermediate values and this was preventing the image from showing up. Removing the print made the image show up. This issue can be closed if this behavior is okay.

@adg
Copy link
Contributor

adg commented Feb 10, 2016

We should probably figure out a more graceful way of handling intermingling
of image data and debug prints. Yours wouldn't have been the only example.

On 10 February 2016 at 16:17, Karthik Krishnan Ramasubramanian <
notifications@github.com> wrote:

I tried running my bit of code again, it turned out that I was debug
printing some intermediate values and this was preventing the image from
showing up. Removing the print made the image show up. This issue can be
closed if this behavior is okay.


Reply to this email directly or view it on GitHub
#14206 (comment).

@adg adg changed the title tour: Running exercise-slices does not display "bluescale" image tour: figure out how to make pic.Show interact well with debug prints Mar 21, 2016
@adg adg removed their assignment May 27, 2016
@agnivade
Copy link
Contributor

agnivade commented Oct 4, 2017

Hi @doublek - Can you mention what are the debug statements that you added that was preventing the image from being shown ? A code example would be really appreciated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants