You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: msg_helpers.go
    path of file: ./repos/sliver/vendor/github.com/miekg/dns
    
    the code of the file until where you have to start completion: package dns

import (
	"encoding/base32"
	"encoding/base64"
	"encoding/binary"
	"encoding/hex"
	"net"
	"sort"
	"strings"
)

// helper functions called from the generated zmsg.go

// These function are named after the tag to help pack/unpack, if there is no tag it is the name
// of the type they pack/unpack (
    
func unpackDataOpt(msg []byte, off int) ([]EDNS0, int, error) {
	var edns []EDNS0
	for off < len(msg) {
		if off+4 > len(msg) {
			return nil, len(msg), &Error{err: "overflow unpacking opt"}
		}
		code := binary.BigEndian.Uint16(msg[off:])
		off += 2
		optlen := binary.BigEndian.Uint16(msg[off:])
		off += 2
		if off+int(optlen) > len(msg) {
			return nil, len(msg), &Error{err: "overflow unpacking opt"}
		}
		opt := makeDataOpt(code)
		if err := opt.unpack(msg[off : off+int(optlen)]); err != nil {
			return nil, len(msg), err
		}
		edns = append(edns, opt)
		off += int(optlen)
	}
	return edns, off, nil
}