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

Fixed deprecated protobuf import reported by staticcheck #557

Merged
merged 1 commit into from
Apr 24, 2020

Conversation

kozlovic
Copy link
Member

Staticcheck test would fail with this error:
"encoders/protobuf/protobuf_enc.go:19:2: package github.com/golang/protobuf/proto is deprecated: Use the "google.golang.org/protobuf/proto" package instead."

I have replaced and regenerated the testdata protobuf code.

I have tested that if an app was built with the library before
the change and would receive a message generated with the updated
import it would work fine.
However an app using the updated library would need to replace

reflect.DeepEqual(m1, m2)

with

reflect.DeepEqual(m1.ProtoReflect(), m2.ProtoReflect())

The protobuf Message has different versions now.
Not sure if this going to break things or not, but the
github.com/golang/protobuf/proto is clearly marked as deprecated.

Signed-off-by: Ivan Kozlovic ivan@synadia.com

"encoders/protobuf/protobuf_enc.go:19:2: package github.com/golang/protobuf/proto is deprecated: Use the "google.golang.org/protobuf/proto" package instead."

I have replaced and regenerated the testdata protobuf code.

I have tested that if an app was built with the library before
the change and would receive a message generated with the updated
import it would work fine.
However an app using the updated library would need to replace

```
reflect.DeepEqual(m1, m2)
```
with
```
reflect.DeepEqual(m1.ProtoReflect(), m2.ProtoReflect())
```
The protobuf Message has different versions now.
Not sure if this going to break things or not, but the
github.com/golang/protobuf/proto is clearly marked as deprecated.

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
@coveralls
Copy link

Coverage Status

Coverage increased (+0.1%) to 91.758% when pulling a3c4236 on fix_deprecated_protobuf into b1f0d19 on master.

Copy link
Member

@derekcollison derekcollison left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Member

@wallyqs wallyqs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, I think we should try the update.

@kozlovic kozlovic merged commit f7af4f2 into master Apr 24, 2020
@kozlovic kozlovic deleted the fix_deprecated_protobuf branch April 24, 2020 23:26
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.

4 participants