<div dir="ltr">I think the go tools do not cover files that are referenced by test code, e.g.:<div><br><div>func TestFoo(t *testing.T) {</div></div><div>  f, err := os.Open("my_test_resource.txt")</div><div>  if err != nil {</div><div>    t.Fatalf("Could not open file: %v", err)</div><div>  }</div><div>  // …</div><div>}</div><div><br></div><div>Did I miss something?</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Jul 30, 2015 at 2:41 AM, Michael Hudson-Doyle <span dir="ltr"><<a href="mailto:michael.hudson@canonical.com" target="_blank">michael.hudson@canonical.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I guess you could ask go by invoking 'go list -json ./...' and looking<br>
for the various *Files fields. The imports/deps calculations won't<br>
work of course because the point of the copy is to get files to where<br>
they _do_ work, but that just means that there are DepsErrors fields<br>
in the json -- the command still completes and gives the needed<br>
information afaics.<br>
<br>
Cheers,<br>
mwh<br>
<span class=""><br>
On 30 July 2015 at 19:10, Michael Stapelberg <<a href="mailto:stapelberg@debian.org">stapelberg@debian.org</a>> wrote:<br>
> Instead of adding this via a new setting, why not make dh-golang install<br>
> these files by default?<br>
><br>
> I think installing everything one can legitimately call program source code<br>
> is fair game. The tricky part is identifying files which are necessary for<br>
> test cases.<br>
><br>
> The reason why dh-golang doesn’t just install all files is because that<br>
> might generate lintian warnings about extra LICENSE files, extra README<br>
> files not being marked as docs, random non-executable shell scripts, etc.<br>
><br>
> That said, I’m not very happy with the current need to specify the<br>
> install_all option in many cases, and any improvements over that (using more<br>
> introspection? using a blacklist instead of a whitelist?) are very welcome.<br>
><br>
> On Wed, Jul 29, 2015 at 10:53 PM, Alexandre Viau<br>
</span><span class="">> <<a href="mailto:alexandre@alexandreviau.net">alexandre@alexandreviau.net</a>> wrote:<br>
>><br>
>> Hello,<br>
>><br>
>> This is new dh-golang feature should allow to include more files to the<br>
>> install in an easier way. It should be useful, for example, with cgo<br>
>> projects.<br>
>><br>
>> DH_GOLANG_INSTALL_EXTRA_EXTENSIONS := .cgo,.h,.c<br>
>><br>
>> Will include all files with .cgo, .h and .c extensions.<br>
>><br>
>> I have had this issue (not just with cgo projects) a couple times last<br>
>> week so I thought this would be useful.<br>
>><br>
>> I have never done perl before, feel free to comment on the code.<br>
>><br>
>> --<br>
>> Alexandre Viau<br>
</span><span class="">>> <a href="mailto:alexandre@alexandreviau.net">alexandre@alexandreviau.net</a><br>
>><br>
>> _______________________________________________<br>
>> Pkg-go-maintainers mailing list<br>
</span>>> <a href="mailto:Pkg-go-maintainers@lists.alioth.debian.org">Pkg-go-maintainers@lists.alioth.debian.org</a><br>
<span class="">>> <a href="http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-go-maintainers" rel="noreferrer" target="_blank">http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-go-maintainers</a><br>
><br>
><br>
><br>
><br>
> --<br>
> Best regards,<br>
> Michael<br>
><br>
</span>> _______________________________________________<br>
> Pkg-go-maintainers mailing list<br>
> <a href="mailto:Pkg-go-maintainers@lists.alioth.debian.org">Pkg-go-maintainers@lists.alioth.debian.org</a><br>
> <a href="http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-go-maintainers" rel="noreferrer" target="_blank">http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-go-maintainers</a><br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature">Best regards,<br>Michael</div>
</div>