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

Allow specifying policy in the top-level module line #22

Merged
merged 1 commit into from
Feb 18, 2025
Merged

Conversation

AkihiroSuda
Copy link
Owner

@AkihiroSuda AkihiroSuda commented Feb 18, 2025

e.g.,

// gomodjail:confined
module example.com/foo

go 1.23

require (
        example.com/mod100 v1.2.3
        example.com/mod101 v1.2.3 // gomodjail:unconfined
        example.com/mod102 v1.2.3
        // gomodjail:unconfined
        example.com/mod103 v1.2.3
)

require (
        // gomodjail:unconfined
        example.com/mod200 v1.2.3 // indirect
        example.com/mod201 v1.2.3 // indirect
)

// policy cannot be specified here because the parser ignores
// the comment lines here
require (
)

This makes the following modules confined: mod100, mod102, and mod201.

e.g.,
```go-module
// gomodjail:confined
module example.com/foo

go 1.23

require (
        example.com/mod100 v1.2.3
        example.com/mod101 v1.2.3 // gomodjail:unconfined
        example.com/mod102 v1.2.3
        // gomodjail:unconfined
        example.com/mod103 v1.2.3
)

require (
        // gomodjail:unconfined
        example.com/mod200 v1.2.3 // indirect
        example.com/mod201 v1.2.3 // indirect
)

// policy cannot be specified here because the parser ignores
// the comment lines here
require (
)
```

This makes the following modules confined: `mod100`, `mod102`, and `mod201`.

Signed-off-by: Akihiro Suda <[email protected]>
@AkihiroSuda AkihiroSuda merged commit c450292 into master Feb 18, 2025
6 checks passed
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

Successfully merging this pull request may close these issues.

1 participant