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: reader.go
    path of file: ./repos/martian/marbl
    
    the code of the file until where you have to start completion: // Copyright 2015 Google Inc. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICE
    
func (r *Reader) ReadFrame() (Frame, error) {
	fh := make([]byte, 10)

	if _, err := io.ReadFull(r.r, fh); err != nil {
		return nil, err
	}

	switch FrameType(fh[0]) {
	case HeaderFrame:
		hf := Header{
			ID:          string(fh[2:]),
			MessageType: MessageType(fh[1]),
		}

		lens := make([]byte, 8)
		if _, err := io.ReadFull(r.r, lens); err != nil {
			return nil, err
		}

		nl := binary.BigEndian.Uint32(lens[:4])
		vl := binary.BigEndian.Uint32(lens[4:])

		nv := make([]byte, int(nl+vl))
		if _, err := io.ReadFull(r.r, nv); err != nil {
			return nil, err
		}

		hf.Name = string(nv[:nl])
		hf.Value = string(nv[nl:])

		return hf, nil
	case DataFrame:
		df := Data{
			ID:          string(fh[2:]),
			MessageType: MessageType(fh[1]),
		}

		// Reading 9 bytes:
		// 4 bytes index
		// 1 byte terminal
		// 4 bytes data length
		desc := make([]byte, 9)
		if _, err := io.ReadFull(r.r, desc); err != nil {
			return nil, err
		}

		df.Index = binary.BigEndian.Uint32(desc[:4])
		df.Terminal = desc[4] == 1

		dl := binary.BigEndian.Uint32(desc[5:])


		data := make([]byte, int(dl))
		if _, err := io.ReadFull(r.r, data); err != nil {
			return nil, err
		}

		df.Data = data

		return df, nil
	default:
		return nil, fmt.Errorf("marbl: unknown type of frame")
	}
}