MCPcopy Create free account
hub / github.com/cloudwego/dynamicgo / ReadInt

Method ReadInt

proto/binary/binary.go:770–799  ·  view source on GitHub ↗

ReadInt containing INT32, SINT32, SFIX32, INT64, SINT64, SFIX64, UINT32, UINT64

(t proto.Type)

Source from the content-addressed store, hash-verified

768
769// ReadInt containing INT32, SINT32, SFIX32, INT64, SINT64, SFIX64, UINT32, UINT64
770func (p *BinaryProtocol) ReadInt(t proto.Type) (value int, err error) {
771 switch t {
772 case proto.INT32:
773 n, err := p.ReadInt32()
774 return int(n), err
775 case proto.SINT32:
776 n, err := p.ReadSint32()
777 return int(n), err
778 case proto.SFIX32:
779 n, err := p.ReadSfixed32()
780 return int(n), err
781 case proto.INT64:
782 n, err := p.ReadInt64()
783 return int(n), err
784 case proto.SINT64:
785 n, err := p.ReadSint64()
786 return int(n), err
787 case proto.SFIX64:
788 n, err := p.ReadSfixed64()
789 return int(n), err
790 case proto.UINT32:
791 n, err := p.ReadUint32()
792 return int(n), err
793 case proto.UINT64:
794 n, err := p.ReadUint64()
795 return int(n), err
796 default:
797 return 0, errInvalidDataType
798 }
799}
800
801// ReadI32
802func (p *BinaryProtocol) ReadInt32() (int32, error) {

Callers 4

searchIntKeyFunction · 0.45
findDeleteChildMethod · 0.45
scanChildrenMethod · 0.45
NextIntMethod · 0.45

Calls 8

ReadInt32Method · 0.95
ReadSint32Method · 0.95
ReadSfixed32Method · 0.95
ReadInt64Method · 0.95
ReadSint64Method · 0.95
ReadSfixed64Method · 0.95
ReadUint32Method · 0.95
ReadUint64Method · 0.95

Tested by

no test coverage detected