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: sync.go
    path of file: ./repos/ente/cli/pkg
    
    the code of the file until where you have to start completion: package pkg

import (
	"context"
	"encoding/base64"
	"fmt"
	"github.com/ente-io/cli/internal"
	"github.com/ente-io/cli/internal/api"
	"github.com/ente-io/cli/pkg/model"
	bolt "go.etcd.io/bbolt"
	"log"
	"time"
)

func (c *ClICtrl) Export() error {
	accounts, err := c.GetAccounts(context.Background())
	if err != nil {
		return err
	}
	if len(accounts) == 0 {
		fmt.Printf("No accounts to sync\n Add account using `account add` cmd\n")
		return nil
	}
	for _, account := range accounts {
		log.SetPrefix(fmt.Sprintf("[%s-%s] ", account.App, account.
    
func (c *ClICtrl) Export() error {
	accounts, err := c.GetAccounts(context.Background())
	if err != nil {
		return err
	}
	if len(accounts) == 0 {
		fmt.Printf("No accounts to sync\n Add account using `account add` cmd\n")
		return nil
	}
	for _, account := range accounts {
		log.SetPrefix(fmt.Sprintf("[%s-%s] ", account.App, account.Email))
		if account.ExportDir == "" {
			log.Printf("Skip account %s: no export directory configured", account.Email)
			continue
		}
		_, err = internal.ValidateDirForWrite(account.ExportDir)
		if err != nil {
			log.Printf("Skip export, error: %v while validing exportDir %s\n", err, account.ExportDir)
			continue
		}
		if account.App == api.AppAuth {
			log.Printf("Skip account %s: auth export is not supported", account.Email)
			continue
		}
		log.Println("start sync")
		retryCount := 0
		for {
			err = c.SyncAccount(account)
			if err != nil {
				if model.ShouldRetrySync(err) && retryCount < 20 {
					retryCount = retryCount + 1
					timeInSecond := time.Duration(retryCount*10) * time.Second
					log.Printf("Connection err, waiting for %s before trying again", timeInSecond.String())
					time.Sleep(timeInSecond)
					continue
				}
				fmt.Printf("Error syncing account %s: %s\n", account.Email, err)
				return err
			} else {
				log.Println("sync done")
				break
			}
		}

	}
	return nil
}