libcontainer/devices: add '//go:fix inline' directives#5223
Merged
kolyshkin merged 1 commit intoopencontainers:mainfrom Apr 6, 2026
Merged
libcontainer/devices: add '//go:fix inline' directives#5223kolyshkin merged 1 commit intoopencontainers:mainfrom
kolyshkin merged 1 commit intoopencontainers:mainfrom
Conversation
This allows users to automaticaly migrate to the new location
using `go fix`. It has some limitations, but can help smoothen
the transition; for example, taking this file;
```
package main
import (
"github.com/opencontainers/runc/libcontainer/devices"
)
func main() {
_, _ = devices.DeviceFromPath("a", "b")
_, _ = devices.HostDevices()
_, _ = devices.GetDevices("a")
}
```
Running `go fix -mod=readonly ./...` will migrate the code;
```
package main
import (
devices0 "github.com/moby/sys/devices"
)
func main() {
_, _ = devices0.DeviceFromPath("a", "b")
_, _ = devices0.HostDevices()
_, _ = devices0.GetDevices("a")
}
```
updates b345c78
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
cyphar
approved these changes
Apr 5, 2026
kolyshkin
approved these changes
Apr 6, 2026
Contributor
|
@thaJeztah thanks! can you please open a backport to 1.5? |
Member
Author
|
Sure thing; hope they help. As mentioned; the |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This allows users to automaticaly migrate to the new location using
go fix. It has some limitations, but can help smoothen the transition; for example, taking this file;Running
go fix -mod=readonly ./...will migrate the code;updates b345c78