just a question render/protobuf.go
type ProtoBuf struct {
Data any
}
var protobufContentType = []string{"application/x-protobuf"}
// Render (ProtoBuf) marshals the given interface object and writes data with custom ContentType.
func (r ProtoBuf) Render(w http.ResponseWriter) error {
r.WriteContentType(w)
bytes, err := proto.Marshal(r.Data.(proto.Message))
why not use proto.Message for Data directly?
type ProtoBuf struct {
Data proto.Message
}
.....
bytes, err := proto.Marshal(r.Data)