jacknguyen92 / go-tour

Automatically exported from code.google.com/p/go-tour
0 stars 0 forks source link

Adding import fmt to tour #38 breaks it #173

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Add fmt import to tour #38

What is the expected output? What do you see instead?
A "debug" line, then a picture.

What I see, which is quite unexpected: How does an import break a package?!

dx=256, dy=256
IMAGE:iVBORw0KGgoAAAANSUhEUgAAAQAAAAEACAIAAADTED8xAAACwklEQVR4nOzTMREAIAzAwB6Hf8
sgo0P+FWTJnXkDVWc7ADYZgDQDkGYA0gxAmgFIMwBpBiDNAKQZgDQDkGYA0gxAmgFIMwBpBiDNAKQZgD
QDkGYA0gxAmgFIMwBpBiDNAKQZgDQDkGYA0gxAmgFIMwBpBiDNAKQZgDQDkGYA0gxAmgFIMwBpBiDNAK
QZgDQDkGYA0gxAmgFIMwBpBiDNAKQZgDQDkGYA0gxAmgFIMwBpBiDNAKQZgDQDkGYA0gxAmgFIMwBpBi
DNAKQZgDQDkGYA0gxAmgFIMwBpBiDNAKQZgDQDkGYA0gxAmgFIMwBpBiDNAKQZgDQDkGYA0gxAmgFIMw
BpBiDNAKQZgDQDkGYA0gxAmgFIMwBpBiDNAKQZgDQDkGYA0gxAmgFIMwBpBiDNAKQZgDQDkGYA0gxAmg
FIMwBpBiDNAKQZgDQDkGYA0gxAmgFIMwBpBiDNAKQZgDQDkGYA0gxAmgFIMwBpBiDNAKQZgDQDkGYA0g
xAmgFIMwBpBiDNAKQZgDQDkGYA0gxAmgFIMwBpBiDNAKQZgDQDkGYA0gxAmgFIMwBpBiDNAKQZgDQDkG
YA0gxAmgFIMwBpBiDNAKQZgDQDkGYA0gxAmgFIMwBpBiDNAKQZgDQDkGYA0gxAmgFIMwBpBiDNAKQZgD
QDkGYA0gxAmgFIMwBpBiDNAKQZgDQDkGYA0gxAmgFIMwBpBiDNAKQZgDQDkGYA0gxAmgFIMwBpBiDNAK
QZgDQDkGYA0gxAmgFIMwBpBiDNAKQZgDQDkGYA0gxAmgFIMwBpBiDNAKQZgDQDkGYA0gxAmgFIMwBpBi
DNAKQZgDQDkGYA0gxAmgFIMwBpBiDNAKQZgDQDkGYA0gxAmgFIMwBpBiDNAKQZgDQDkGYA0gxAmgFIMw
BpBiDNAKQZgDQDkGYA0gxAmgFIMwBpPwAA//9aqAMCcHlkOwAAAABJRU5ErkJggg==

What version of the product are you using? On what operating system?
http://tour.golang.org/#38

Please provide any additional information below.
Code:

package main

import (
    "code.google.com/p/go-tour/pic"
    "fmt"
)

func Pic(dx, dy int) [][]uint8 {
    fmt.Printf("dx=%d, dy=%d\n", dx, dy)
    graph := make([][]uint8, dy)
    for y := range graph {
        graph[y] = make([]uint8, dx)
    }
    return graph
}

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

Original issue reported on code.google.com by dcl...@google.com on 10 Apr 2014 at 6:27

GoogleCodeExporter commented 9 years ago
Found out that this is due to magic in the tour, so this can be closed.

Original comment by dcl...@google.com on 10 Apr 2014 at 11:22

GoogleCodeExporter commented 9 years ago
There may be a more clever way to process the emitted image, but we're not 
doing it yet.

Original comment by a...@golang.org on 10 Apr 2014 at 11:24

GoogleCodeExporter commented 9 years ago
There may be a more clever way to process the emitted image, but we're not 
doing it yet.

Original comment by a...@golang.org on 10 Apr 2014 at 11:24