To clarify, the `// +build tools` should make the compiler skip building 
this file because the "tools" constraint will never be met, but allows go 
modules to add it to the dependency list. It just looks like go mod tidy 
doesn't like non go repositories.

On Thursday, December 19, 2019 at 10:42:55 PM UTC-8, John Krzemien wrote:
>
> Hello- I have a go project with a list of dependencies that are tools. 
> They aren't directly included by any .go files in the repos, so instead I 
> have a file called "tools.go" with a build constraints 
> <https://golang.org/pkg/go/build/#hdr-Build_Constraints>. One dependency "
> tools-project" doesn't have any golang code:
>
>
> // +build tools
>
> package tools
>
> import (
>     github.com/some-team/tools-project
> )
>
>
>
>  This works to make go modules happy, but `go mod tidy` and `go mod why` 
> fail with an error like this: 
>
> github.com/my-team/my-project/pkg imports
>  github.com/some-team/tools-project: module 
> github.com/some-team/tools-project@latest 
> found (vX.X.X), but does not contain package github.com/some-team/tools-
> project
>
> This might be because there's no golang code in that tool repo? I was 
> wondering if there's a better way to specify and keep a versioned lock on a 
> non golang repo.
>
> Thanks.
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/333b77ec-49b8-4107-998a-47c004059aeb%40googlegroups.com.

Reply via email to