bytes returns the portion of `buf` corresponding to the member.
(buf []byte)
| 49 | |
| 50 | // bytes returns the portion of `buf` corresponding to the member. |
| 51 | func (ml *structOpsMemberLayout) bytes(buf []byte) ([]byte, error) { |
| 52 | if ml.off < 0 || ml.off+ml.size > len(buf) { |
| 53 | return nil, fmt.Errorf("member %q: value buffer too small", ml.member.Name) |
| 54 | } |
| 55 | return buf[ml.off : ml.off+ml.size], nil |
| 56 | } |
| 57 | |
| 58 | // structOpsFuncPtrMember returns an error unless m is a func pointer member. |
| 59 | func structOpsFuncPtrMember(m btf.Member) error { |
no outgoing calls
no test coverage detected