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: print.go
    path of file: ./repos/easegress/cmd/client/general
    
    the code of the file until where you have to start completion: /*
 * Copyright (c) 2017, The Easegress Authors
 * 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/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

// Package general provides the general utilities for the client.
package general

import (
	"bytes"
	"encoding/json"
	"fmt"
	"os"
	"sort"
	"strings"
	"text/tabwriter"
	"time"

	"github.com/megaease/easegress/v2/pkg/util/codectool"
	"github.com/megaease/easegress/v2/pkg/util/stringtool"
	"github.com/spf13/cobra"
)

// PrintBody prints the response body in yaml or json format.
func PrintBody(body []byte) {
	if len(body) == 0 {
		return
	}

	var output []byte
	switch CmdGlobalFlags.OutputFormat {
	case JSONFormat:
		var prettyJS
    
func PrintMapInterface(maps []map[string]interface{}, fronts []string, backs []string) {
	cutLine := func(line string) string {
		if CmdGlobalFlags.Verbose || len(line) < 50 {
			return line
		}
		return line[0:50] + "..."
	}

	printKV := func(k string, v interface{}) {
		value, err := codectool.MarshalYAML(v)
		if err != nil {
			ExitWithError(err)
		}

		lines := strings.Split(string(value), "\n")
		lines = lines[0 : len(lines)-1]
		if len(lines) == 1 {
			fmt.Printf("%s: %s\n", Capitalize(k), cutLine(lines[0]))
			return
		}
		fmt.Printf("%s:\n", Capitalize(k))
		fmt.Printf("%s\n", strings.Repeat("=", len(k)+1))
		for _, line := range lines {
			fmt.Printf("  %s\n", line)
		}
	}

	printFn := func(spec map[string]interface{}) {
		spec = func(s map[string]interface{}) map[string]interface{} {
			res := map[string]interface{}{}
			for k, v := range s {
				res[lowerFirstLetter(k)] = v
			}
			return res
		}(spec)

		type kv struct {
			key   string
			value interface{}
		}

		var kvs []kv
		for k, v := range spec {
			kvs = append(kvs, kv{k, v})
		}
		sort.Slice(kvs, func(i, j int) bool {
			return kvs[i].key < kvs[j].key
		})

		frontFlag := false
		for _, f := range fronts {
			if f == "" && frontFlag {
				fmt.Println()
			}
			value, ok := spec[f]
			if ok {
				frontFlag = true
				printKV(f, value)
			} else {
				frontFlag = false
			}
		}

		for _, kv := range kvs {
			if stringtool.StrInSlice(kv.key, fronts) {
				continue
			}
			if stringtool.StrInSlice(kv.key, backs) {
				continue
			}
			printKV(kv.key, kv.value)
		}

		backFlag := false
		for _, b := range backs {
			value, ok := spec[b]
			if ok {
				if !backFlag {
					fmt.Println()
					backFlag = true
				}
				printKV(b, value)
			}
		}
	}

	for i, m := range maps {
		printFn(m)
		if len(maps) > 1 && i != len(maps)-1 {
			fmt.Print("\n\n---\n\n")
		}
	}
}