proto_methods.go 457 B

1234567891011121314151617
  1. // Copyright 2019 The Go Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style
  3. // license that can be found in the LICENSE file.
  4. // The protoreflect build tag disables use of fast-path methods.
  5. // +build !protoreflect
  6. package proto
  7. import "google.golang.org/protobuf/runtime/protoiface"
  8. func protoMethods(m Message) *protoiface.Methods {
  9. if x, ok := m.(protoiface.Methoder); ok {
  10. return x.XXX_Methods()
  11. }
  12. return nil
  13. }