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: encode.go
    path of file: ./repos/kubeedge/vendor/github.com/BurntSushi/toml
    
    the code of the file until where you have to start completion: package toml

import (
	"bufio"
	"encoding"
	"encoding/json"
	"errors"
	"fmt"
	"io"
	"math"
	"reflect"
	"sort"
	"strconv"
	"strings"
	"time"

	"github.com/BurntSushi/toml/internal"
)

type tomlEncodeError struct{ error }

var (
	errArrayNilElement = errors.New("toml: cannot encode array with nil element")
	errNonString       = errors.New("toml: cannot encode a map with non-string key type")
	errNoKey           = errors.New("toml: top-level values must be Go maps or structs")
	errAnything        = errors.New("") // used in testing
)

var dblQuotedReplacer = strings.NewReplacer(
	"\"", "\\\"",
	"\\", "\\\\",
	"\x00", `\u000
    
func (enc *Encoder) isEmpty(rv reflect.Value) bool {
	switch rv.Kind() {
	case reflect.Array, reflect.Slice, reflect.Map, reflect.String:
		return rv.Len() == 0
	case reflect.Struct:
		if rv.Type().Comparable() {
			return reflect.Zero(rv.Type()).Interface() == rv.Interface()
		}
		// Need to also check if all the fields are empty, otherwise something
		// like this with uncomparable types will always return true:
		//
		//   type a struct{ field b }
		//   type b struct{ s []string }
		//   s := a{field: b{s: []string{"AAA"}}}
		for i := 0; i < rv.NumField(); i++ {
			if !enc.isEmpty(rv.Field(i)) {
				return false
			}
		}
		return true
	case reflect.Bool:
		return !rv.Bool()
	}
	return false
}