Skip to content

api, client: add //go:fix inline directives to deprecated functions#52178

Merged
thaJeztah merged 4 commits intomoby:masterfrom
thaJeztah:client_gofix
Mar 20, 2026
Merged

api, client: add //go:fix inline directives to deprecated functions#52178
thaJeztah merged 4 commits intomoby:masterfrom
thaJeztah:client_gofix

Conversation

@thaJeztah
Copy link
Copy Markdown
Member

@thaJeztah thaJeztah commented Mar 15, 2026

api, client: add //go:fix inline directives to deprecated functions

This allows (with limitations) users to automatically upgrade to the replacements (see https://go.dev/blog/inliner);

go fix -mod=readonly ./...

golanci-lint: gocheckcompilerdirectives: ignore "//go:fix"

The linter has not been updated yet to recognize this directive.

api/types/strslice: add //go:fix inline directives for deprecated type

This allows go fix ./.. to automatically migrate legacy code.

client: add //go:fix inline directives to deprecated functions

This allows go fix ./.. to automatically migrate legacy code.

add example for go fix

Add an example package to verify the //go:fix inline comments
work; some cases do not work (for which I opened tickets in the
go issue tracker).

- Human readable description for the release notes

api, client: add `//go:fix inline` directives to deprecated functions to help automatically migrating using `go fix`

- A picture of a cute animal (not mandatory but encouraged)

@thaJeztah thaJeztah added this to the 29.3.1 milestone Mar 15, 2026
@thaJeztah thaJeztah added status/2-code-review kind/enhancement Enhancements are not bugs or new features but can improve usability or performance. area/go-sdk module/api module/client labels Mar 15, 2026
The linter has not been updated yet to recognize this directive.

Signed-off-by: Sebastiaan van Stijn <[email protected]>
This allows `go fix ./..` to automatically migrate legacy code.

Signed-off-by: Sebastiaan van Stijn <[email protected]>
This allows `go fix ./..` to automatically migrate legacy code.

Signed-off-by: Sebastiaan van Stijn <[email protected]>
Add an example package to verify the `//go:fix inline` comments
work; some cases do not work (for which I opened tickets in the
go issue tracker).

Signed-off-by: Sebastiaan van Stijn <[email protected]>
@thaJeztah thaJeztah marked this pull request as ready for review March 19, 2026 18:48
@thaJeztah thaJeztah merged commit e45c5ce into moby:master Mar 20, 2026
252 of 253 checks passed
@thaJeztah thaJeztah deleted the client_gofix branch March 20, 2026 00:50
@thaJeztah thaJeztah added impact/changelog impact/go-sdk Noteworthy (compatibility changes) in the Go SDK labels Apr 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/go-sdk impact/changelog impact/go-sdk Noteworthy (compatibility changes) in the Go SDK kind/enhancement Enhancements are not bugs or new features but can improve usability or performance. module/api module/client status/2-code-review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants