{"action":"closed","issue":{"url":"https://api.github.com/repos/golang/go/issues/28397","repository_url":"https://api.github.com/repos/golang/go","labels_url":"https://api.github.com/repos/golang/go/issues/28397/labels{/name}","comments_url":"https://api.github.com/repos/golang/go/issues/28397/comments","events_url":"https://api.github.com/repos/golang/go/issues/28397/events","html_url":"https://github.com/golang/go/issues/28397","id":374152337,"node_id":"MDU6SXNzdWUzNzQxNTIzMzc=","number":28397,"title":"cmd/go: 'go mod tidy' does not add indirect private dependencies","user":{"login":"karysto","id":6022002,"node_id":"MDQ6VXNlcjYwMjIwMDI=","avatar_url":"https://avatars3.githubusercontent.com/u/6022002?v=4","gravatar_id":"","url":"https://api.github.com/users/karysto","html_url":"https://github.com/karysto","followers_url":"https://api.github.com/users/karysto/followers","following_url":"https://api.github.com/users/karysto/following{/other_user}","gists_url":"https://api.github.com/users/karysto/gists{/gist_id}","starred_url":"https://api.github.com/users/karysto/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/karysto/subscriptions","organizations_url":"https://api.github.com/users/karysto/orgs","repos_url":"https://api.github.com/users/karysto/repos","events_url":"https://api.github.com/users/karysto/events{/privacy}","received_events_url":"https://api.github.com/users/karysto/received_events","type":"User","site_admin":false},"labels":[{"id":373402289,"node_id":"MDU6TGFiZWwzNzM0MDIyODk=","url":"https://api.github.com/repos/golang/go/labels/NeedsInvestigation","name":"NeedsInvestigation","color":"ededed","default":false},{"id":992189327,"node_id":"MDU6TGFiZWw5OTIxODkzMjc=","url":"https://api.github.com/repos/golang/go/labels/modules","name":"modules","color":"bac2ff","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/golang/go/milestones/6","html_url":"https://github.com/golang/go/milestone/6","labels_url":"https://api.github.com/repos/golang/go/milestones/6/labels","id":1055141,"node_id":"MDk6TWlsZXN0b25lMTA1NTE0MQ==","number":6,"title":"Unplanned","description":"No plan to fix in any specific release.\r\n","creator":{"login":"rsc","id":104030,"node_id":"MDQ6VXNlcjEwNDAzMA==","avatar_url":"https://avatars1.githubusercontent.com/u/104030?v=4","gravatar_id":"","url":"https://api.github.com/users/rsc","html_url":"https://github.com/rsc","followers_url":"https://api.github.com/users/rsc/followers","following_url":"https://api.github.com/users/rsc/following{/other_user}","gists_url":"https://api.github.com/users/rsc/gists{/gist_id}","starred_url":"https://api.github.com/users/rsc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rsc/subscriptions","organizations_url":"https://api.github.com/users/rsc/orgs","repos_url":"https://api.github.com/users/rsc/repos","events_url":"https://api.github.com/users/rsc/events{/privacy}","received_events_url":"https://api.github.com/users/rsc/received_events","type":"User","site_admin":false},"open_issues":1799,"closed_issues":1250,"state":"open","created_at":"2015-04-06T20:47:19Z","updated_at":"2018-10-26T18:35:19Z","due_on":"2099-12-31T08:00:00Z","closed_at":null},"comments":2,"created_at":"2018-10-25T22:07:56Z","updated_at":"2018-10-26T18:35:19Z","closed_at":"2018-10-26T18:35:18Z","author_association":"NONE","body":"### What version of Go are you using (`go version`)?\r\ngo version go1.11.1 linux/amd64\r\n\r\n### Does this issue reproduce with the latest release?\r\nYes\r\n\r\n### What operating system and processor architecture are you using (`go env`)?\r\nGOARCH=\"amd64\"\r\nGOBIN=\"\"\r\nGOCACHE=\"/home/karysto/.cache/go-build\"\r\nGOEXE=\"\"\r\nGOFLAGS=\"\"\r\nGOHOSTARCH=\"amd64\"\r\nGOHOSTOS=\"linux\"\r\nGOOS=\"linux\"\r\nGOPATH=\"/home/karysto/go\"\r\nGOPROXY=\"\"\r\nGORACE=\"\"\r\nGOROOT=\"/usr/local/go\"\r\nGOTMPDIR=\"\"\r\nGOTOOLDIR=\"/usr/local/go/pkg/tool/linux_amd64\"\r\nGCCGO=\"gccgo\"\r\nCC=\"gcc\"\r\nCXX=\"g++\"\r\nCGO_ENABLED=\"1\"\r\nGOMOD=\"\"\r\nCGO_CFLAGS=\"-g -O2\"\r\nCGO_CPPFLAGS=\"\"\r\nCGO_CXXFLAGS=\"-g -O2\"\r\nCGO_FFLAGS=\"-g -O2\"\r\nCGO_LDFLAGS=\"-g -O2\"\r\nPKG_CONFIG=\"pkg-config\"\r\nGOGCCFLAGS=\"-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build201986556=/tmp/go-build -gno-record-gcc-switches\"\r\n\r\n### What did you do?\r\nI have a private repo I'm working on called `parent_repo`, it imports another private repo I wrote called `child_repo`. `child_repo` imports another private repo I wrote called `grandchild_repo`. All of these repos have `go.mod` files. In this case, `grandchild_repo` is an indirect dependency of `parent_repo`.\r\n\r\nWhen I run `go mod tidy` on `parent_repo`, `child_repo` appears, but `grandchild_repo` does not. After adding `grandchild_repo` manually to `parent_repo`'s mod file (with an associated `replace` directive to find it locally), `go mod vendor` and `go build -mod=vendor` works perfectly, the build succeeds. The problem is that if I do `go mod tidy` on `parent_repo`, my manually added `grandchild_repo` entry is removed, and my builds fail.\r\n\r\nMy use case is wanting to automate gathering dependencies to vendor before running  a CI pipeline, but I can't right now because of this issue.\r\n\r\n### What did you expect to see?\r\nI expected to see `go mod tidy` add my indirect dependency to go.mod (so that I didn't have to add it manually) and the build to succeed as a result.\r\n\r\n### What did you see instead?\r\nI see go.mod tidy remove the grandchild dependency and the build failing\r\n"}}
{"actor":{"display_login":"myitcv"}}