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: identified.go
    path of file: ./repos/kubeedge/vendor/github.com/256dpi/gomqtt/packet
    
    the code of the file until where you have to start completion: package packet

import (
	"encoding/binary"
	"fmt"
)

// returns the byte length of an identified packet
func identifiedLen() int {
	return headerLen(2) + 2
}

// decodes an identified packet
func identifiedDecode(src []byte, t Type) (int, ID, error) {
	total := 0

	// decode header
	hl, _, rl, err := headerDecode(src, t
    
func identifiedDecode(src []byte, t Type) (int, ID, error) {
	total := 0

	// decode header
	hl, _, rl, err := headerDecode(src, t)
	total += hl
	if err != nil {
		return total, 0, err
	}

	// check remaining length
	if rl != 2 {
		return total, 0, makeError(t, "expected remaining length to be 2")
	}

	// read packet id
	packetID := ID(binary.BigEndian.Uint16(src[total:]))
	total += 2

	// check packet id
	if !packetID.Valid() {
		return total, 0, makeError(t, "packet id must be grater than zero")
	}

	return total, packetID, nil
}