Skip to content

Twirp generates code that uses deprecated protobuf libraries #301

@RoarkeRandall

Description

@RoarkeRandall

Our team uses staticcheck, https://staticcheck.io, for linting our go programs. It's convenient to run staticcheck ./... on a repo in our ci pipelines. We are getting the following errors for the generated twirp code:

pkg/go/service.twirp.go:21:8: package github.com/golang/protobuf/jsonpb is deprecated: Use the "google.golang.org/protobuf/encoding/protojson" package instead.  (SA1019)
pkg/go/service.twirp.go:22:8: package github.com/golang/protobuf/proto is deprecated: Use the "google.golang.org/protobuf/proto" package instead.  (SA1019)

We are able to ignore these at a file level, but it requires us to manually add a line of code to the top of the generated file. Obviously editing generated code isn't a great solution.

Is it possible for twirp to update the generated code to use the latest protobuf packages?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions