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

Installing examples is not working anymore #1119

Closed
itsmylife opened this issue Aug 18, 2022 · 5 comments
Closed

Installing examples is not working anymore #1119

itsmylife opened this issue Aug 18, 2022 · 5 comments
Labels

Comments

@itsmylife
Copy link

I am trying to install the examples with the command below:

$ go install github.com/prometheus/client_golang/examples/random@latest

but I am getting the following error:

go: github.com/prometheus/client_golang/examples/random@latest (in github.com/prometheus/client_golang@v1.13.0):
	The go.mod file for the module providing named packages contains one or
	more exclude directives. It must not contain directives that would cause
	it to be interpreted differently than if it were the main module.

This was working with the previous version:

go install github.com/prometheus/client_golang/examples/random@v1.12.2

I assume the changes introduced here #1062 are the reason. Especially this line:
https://github.com/prometheus/client_golang/blob/main/go.mod#L31

My Go Version:

go version go1.18.1 darwin/arm64
@beorn7
Copy link
Member

beorn7 commented Aug 23, 2022

Maybe we need the examples to use their own go.mod? But that might lead to weird situations…

Or we can reconsider the exclude directive? IIRC it was only added to silence buggy security scanners (that would be confused by the dependency resolution method of Go Modules when faced with circular dependencies).

@kakkoyun
Copy link
Member

Both the strategies make sense.
With the new Go workspace features having different modules in a project should be rather easier.
Also, we might already have deprecated the need for the exclude, if I'm not mistaken we have bumped the minimum required Go version since then. And the issue was related to the older Go version. (I might misremembering things).

@Dean-Coakley
Copy link
Contributor

I've started taking a look at this issue to see if I can help.

  1. I'm pretty new to workspaces. Should go.work be committed, or should I add an entry to .gitignore?
  2. After I've made my changes how do I validate that I've solved the original issue?

@stale
Copy link

stale bot commented Apr 2, 2023

Hello 👋 Looks like there was no activity on this issue for the last 3 months. Do you mind updating us on the status? Is this still reproducible or needed? If yes, just comment on this PR or push a commit. Thanks! 🤗
If there will be no activity in the next 4 weeks, this issue will be closed (we can always reopen an issue if we need!).

@stale stale bot added the stale label Apr 2, 2023
@stale
Copy link

stale bot commented Sep 17, 2023

Closing for now as promised, let us know if you need this to be reopened! 🤗

@stale stale bot closed this as completed Sep 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants