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: error_file.go
    path of file: ./repos/client/go/kbfs/libfs
    
    the code of the file until where you have to start completion: // Copyright 2015-2016 Keybase Inc. All rights reserved.
// Use of this source code is governed by a BSD
// license that can be found in the LICENSE file.

package libfs

import (
	"time"

	goerrors "github.com/go-errors/errors"
	"github.com/keybase/client/go/kbfs/libkbfs"
	"golang.org/x/net/context"
)

// JSONReportedError stringifies the reported error before marshalling
type JSONReportedError struct {
	Time  time.Time
	Error string
	Stack []goerrors.StackFrame
    
func GetEncodedErrors(config libkbfs.Config) func(context.Context) ([]byte, time.Time, error) {
	return func(_ context.Context) ([]byte, time.Time, error) {
		errors := config.Reporter().AllKnownErrors()
		jsonErrors := make([]JSONReportedError, len(errors))
		for i, e := range errors {
			jsonErrors[i].Time = e.Time
			jsonErrors[i].Error = e.Error.Error()
			jsonErrors[i].Stack = convertStack(e.Stack)
		}
		data, err := PrettyJSON(jsonErrors)
		var t time.Time
		if len(errors) > 0 {
			t = errors[len(errors)-1].Time
		}
		return data, t, err
	}
}