blob: 86dde4ade469c662c1a9745c4880e31e389b577d [file] [log] [blame]
Damien Neilcc2b0782019-04-05 14:33:10 -07001// 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
5// The protoreflect build tag disables use of fast-path methods.
6// +build !protoreflect
7
8package proto
9
Joe Tsai0f81b382019-07-10 23:14:31 -070010import (
11 "google.golang.org/protobuf/reflect/protoreflect"
12 "google.golang.org/protobuf/runtime/protoiface"
13)
Damien Neilcc2b0782019-04-05 14:33:10 -070014
Joe Tsai705acad2019-09-14 18:22:59 -070015const hasProtoMethods = true
16
Joe Tsai0f81b382019-07-10 23:14:31 -070017func protoMethods(m protoreflect.Message) *protoiface.Methods {
Damien Neilcc2b0782019-04-05 14:33:10 -070018 if x, ok := m.(protoiface.Methoder); ok {
Joe Tsai0f81b382019-07-10 23:14:31 -070019 return x.ProtoMethods()
Damien Neilcc2b0782019-04-05 14:33:10 -070020 }
21 return nil
22}