Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmd/go: No `// indirect` dependency for imports in example files #28216

Closed
flibustenet opened this issue Oct 15, 2018 · 2 comments

Comments

Projects
None yet
3 participants
@flibustenet
Copy link

commented Oct 15, 2018

What version of Go are you using (go version)?

go 1.11.1

What operating system and processor architecture are you using (go env)?

linux amd64

What did you do?

I import github.com/go-ole/go-ole in my app
This lib currently has no go.mod file and import github.com/gonuts/commander in an example file https://github.com/go-ole/go-ole/blob/master/example/itunes/itunes.go

I run go mod tidy in my app

package main

import (
	"fmt"

	ole "github.com/go-ole/go-ole"
)

func main() {
	fmt.Println(ole.VT_EMPTY)

}

What did you expect to see?

module t

require github.com/go-ole/go-ole v1.2.1
require github.com/gonuts/commander v0.1.0 // indirect

What did you see instead?

module t

require github.com/go-ole/go-ole v1.2.1

No line with require github.com/gonuts/commander v0.1.0 // indirect

@FiloSottile

This comment has been minimized.

Copy link
Member

commented Oct 15, 2018

/cc @bcmills

@bcmills

This comment has been minimized.

Copy link
Member

commented Oct 24, 2018

The package github.com/go-ole/go-ole doesn't import go-ole/example/itunes, so github.com/gonuts/commander isn't in the package-import graph of your module. That's why go mod tidy doesn't try to resolve it, and why it doesn't add a requirement for it.

@bcmills bcmills closed this Oct 24, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.