<p dir="auto">What version of Go are you using (go version)?<br>
I have tried go1.5rc1 and building from source:<br>
go version devel +6f0c7df Tue Aug 18 17:00:59 2015 +0000 linux/amd64</p>
<p dir="auto">What operating system and processor architecture are you using?<br>
Linux 3.4, amd64</p>
<p dir="auto">What did you do?<br>
Build a distribution of our library as a tarball of the desired contents of GOPATH/src and GOPATH/pkg. Our distribution script implements the "mtime hack" discussed <a href="http://stackoverflow.com/a/28407323" rel="nofollow">here</a>, packaging dummy source files that only contain the package declaration line and .a files that have an mtime later than the corresponding source files.</p>
<p dir="auto">Then to test our distribution we try to build an executable that imports the libraries in our distribution.</p>
<p dir="auto">What did you expect to see?<br>
A built executable.</p>
<p dir="auto">What did you see instead?<br>
The go tool complains about missing structs and funcs in our dummy go files.</p>
<p dir="auto">This issue is also referenced in <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="51279689" data-permission-text="Title is private" data-url="https://github.com/golang/go/issues/2775" data-hovercard-type="issue" data-hovercard-url="/golang/go/issues/2775/hovercard" href="https://github.com/golang/go/issues/2775">#2775</a></p>
<p dir="auto">I also tried to use the shared library feature of go1.5 to distribute our library, but that appears to also require the source code.</p>
<p dir="auto">by <strong>czapkofan</strong>:</p>
<pre class="notranslate">What steps will reproduce the problem?
1. Try to compile the following code ("test01-forrange.go"):
package main

var tab = []int{55, 44, 33}

func main() {
    var i int
    for i, v := range tab {
        if v == 44 {
            break
        }
    }
    print(i)
}

What is the expected output?
(compilation succeeds)

What do you see instead?
test01-forrange.go:7: i declared and not used

Which compiler are you using (5g, 6g, 8g, gccgo)?
8g

Which operating system are you using?
Linux

Which revision are you using?  (hg identify)
409c37909d73 tip

Please provide any additional information below.
Current behaviour in the code example is different to one employed in regular :=
variables assignment statement - the latter allows mixing pre-declared variables with
newly created ones. I believe that the difference is against the "principle of
least surprise".</pre>