func printResponseKey(resp *client.Response, format string) {
	// Format the result.
	switch format {
	case "simple":
		if resp.Action != "delete" {
			fmt.Println(resp.Node.Value)
		} else {
			fmt.Println("PrevNode.Value:", resp.PrevNode.Value)
		}
	case "extended":
		// Extended prints in a rfc2822 style format
		fmt.Println("Key:", resp.Node.Key)
		fmt.Println("Created-Index:", resp.Node.CreatedIndex)
		fmt.Println("Modified-Index:", resp.Node.ModifiedIndex)

		if resp.PrevNode != nil {
			fmt.Println("PrevNode.Value:", resp.PrevNode.Value)
		}

		fmt.Println("TTL:", resp.Node.TTL)
		fmt.Println("Index:", resp.Index)
		if resp.Action != "delete" {
			fmt.Println("")
			fmt.Println(resp.Node.Value)
		}
	case "json":
		b, err := json.Marshal(resp)
		if err != nil {
			panic(err)
		}
		fmt.Println(string(b))
	default:
		fmt.Fprintln(os.Stderr, "Unsupported output format:", format)
	}
}
func printResponseKey(resp *client.Response, format string) {
	// Format the result.
	switch format {
	case "simple":
		if resp.Action != "delete" {
			fmt.Println(resp.Node.Value)
		} else {
			fmt.Println("PrevNode.Value:", resp.PrevNode.Value)
		}
	case "extended":
		// Extended prints in a rfc2822 style format
		fmt.Println("Key:", resp.Node.Key)
		fmt.Println("Created-Index:", resp.Node.CreatedIndex)
		fmt.Println("Modified-Index:", resp.Node.ModifiedIndex)

		if resp.PrevNode != nil {
			fmt.Println("PrevNode.Value:", resp.PrevNode.Value)
		}

		fmt.Println("TTL:", resp.Node.TTL)
		fmt.Println("Index:", resp.Index)
		if resp.Action != "delete" {
			fmt.Println("")
			fmt.Println(resp.Node.Value)
		}
	case "json":
		b, err := json.Marshal(resp)
		if err != nil {
			panic(err)
		}
		fmt.Println(string(b))
	default:
		fmt.Fprintln(os.Stderr, "Unsupported output format:", format)
	}
}
func printResponseKey ( resp * client . Response , format string ) { // Format the result. switch format { case " " : if resp . Action != " " { fmt . Println ( resp . Node . Value ) } else { fmt . Println ( " " , resp . PrevNode . Value ) } case " " : // Extended prints in a rfc2822 style format fmt . Println ( " " , resp . Node . Key ) fmt . Println ( " " , resp . Node . CreatedIndex ) fmt . Println ( " " , resp . Node . ModifiedIndex ) if resp . PrevNode != nil { fmt . Println ( " " , resp . PrevNode . Value ) } fmt . Println ( " " , resp . Node . TTL ) fmt . Println ( " " , resp . Index ) if resp . Action != " " { fmt . Println ( " " ) fmt . Println ( resp . Node . Value ) } case " " : b , err := json . Marshal ( resp ) if err != nil { panic ( err ) } fmt . Println ( string ( b ) ) default : fmt . Fprintln ( os . Stderr , " " , format ) } }
// printResponseKey only supports to print key correctly.
printResponseKey only supports to print key correctly .