[pkg-go] Circular dependency in a test file
    Arnaud 
    arnaud.rebillout at collabora.com
       
    Tue Feb 13 11:37:45 UTC 2018
    
    
  
Dear pkg-go maintainers,
I bumped into a trouble while packaging
<https://github.com/containerd/typeurl>.
The library is fairly simple, however the file marshal_test.go [1]
contains this line:
  eventsapi "github.com/containerd/containerd/api/services/events/v1"
This is a circulare dependency, since containerd/typeurl is a depency of
of containerd/containerd, but requires containerd/containerd for this test.
This breaks dh-make-golang with this error:
2018/02/13 18:29:20 Downloading "github.com/containerd/typeurl/..."
go get: 82.03 MiBpackage github.com/containerd/typeurl
    imports github.com/containerd/containerd/typeurl: cannot find
package "github.com/containerd/containerd/typeurl" in any of:
    /usr/lib/go-1.7/src/github.com/containerd/containerd/typeurl (from
$GOROOT)
   
/tmp/dh-make-golang738896973/src/github.com/containerd/containerd/typeurl
(from $GOPATH)
2018/02/13 18:29:44 Could not create a tarball of the upstream source:
exit status 1
The fact that it breaks dh-make-dolang is not the blocker here, as I can
workaround and create the packaging files manually. However, what should
I do with this `marshal_test.go` file ? Should I exclude it from the
package ? Or should I patch it ?
And more generally: I've noticed that a lot of go packages have test
files named `*_test.go` Is it good policy to remove them from the
package when they get in the way like this ? Or are they needed in some
way that I don't expect ?
Thanks,
  Arnaud
[1]: https://github.com/containerd/typeurl/blob/master/marshal_test.go
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.alioth.debian.org/pipermail/pkg-go-maintainers/attachments/20180213/20b2cf7b/attachment.html>
    
    
More information about the Pkg-go-maintainers
mailing list