You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Linting go files...
WARN The linter 'tenv' is deprecated (since v1.64.0) due to: Duplicate feature another linter. Replaced by usetesting.
pkg/templates/templating.go:77:7: right hand must be only type assertion (forcetypeassert)
b, err = raw.(*structpb.Value).MarshalJSON()
^
pkg/templates/templating.go:85:7: right hand must be only type assertion (forcetypeassert)
b, err = raw.(*structpb.Value).MarshalJSON()
^
pkg/templates/templating.go:93:7: right hand must be only type assertion (forcetypeassert)
s, err := protojson.Marshal(raw.(proto.Message))
^
pkg/templates/templating.go:101:7: right hand must be only type assertion (forcetypeassert)
s, err := protojson.Marshal(raw.(proto.Message))
^
pkg/templates/templating.go:109:7: right hand must be only type assertion (forcetypeassert)
b, err = json.Marshal(raw.(*structpb.Value).GetBoolValue())
^
make: *** [Makefile:86: lint-go] Error 1
The text was updated successfully, but these errors were encountered:
Go 1.22 introduced a restriction where type assertions in multiple
assignments must be standalone.
This fix ensures compliance by:
- Separating type assertions before passing values to functions.
- Adding error handling for failed assertions to prevent runtime panics.
- Consolidating duplicate cases for cleaner logic.
This resolves golangci-lint 'forcetypeassert' errors.
Fixesopenshift-pipelines#1932
Signed-off-by: Chmouel Boudjnah <[email protected]>
chmouel
added a commit
to chmouel/pipelines-as-code
that referenced
this issue
Feb 14, 2025
Go 1.22 introduced a restriction where type assertions in multiple
assignments must be standalone.
This fix ensures compliance by:
- Separating type assertions before passing values to functions.
- Adding error handling for failed assertions to prevent runtime panics.
- Consolidating duplicate cases for cleaner logic.
This resolves golangci-lint 'forcetypeassert' errors.
Fixesopenshift-pipelines#1932
Signed-off-by: Chmouel Boudjnah <[email protected]>
Go 1.22 introduced a restriction where type assertions in multiple
assignments must be standalone.
This fix ensures compliance by:
- Separating type assertions before passing values to functions.
- Adding error handling for failed assertions to prevent runtime panics.
- Consolidating duplicate cases for cleaner logic.
This resolves golangci-lint 'forcetypeassert' errors.
Fixes#1932
Signed-off-by: Chmouel Boudjnah <[email protected]>
The text was updated successfully, but these errors were encountered: