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

It seems that when allowing only $gostd, any package which domain name starts with an std go package name will be allowed #108

Open
apostasie opened this issue Feb 24, 2025 · 1 comment

Comments

@apostasie
Copy link

Title says all.

package main

import (
	"go.opentelemetry.io/otel/metric"
	"gotest.tools/v3/assert"
         "go.evil.me/whatever"
         "fmt.evil.me/whateverelse"
)

If you allow $gostd, depguard will be happy with this ^.

I assume this comes from the way comparison is done in: https://github.com/OpenPeeDeeP/depguard/blob/v2/settings.go#L224C6-L240

Am I misunderstanding something here?

Let me know your thoughts.

@dixonwille
Copy link
Member

Sorry for the wait for a response, I believe I do a prefix match. For example you import "fmt" or "os/exec". I'll see if I can come up with something that pervents domain_name.tld when looking at $gostd packages.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants