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

import (
	"log/slog"

	"github.com/moond4rk/hackbrowserdata/browsingdata/bookmark"
	"github.com/moond4rk/hackbrowserdata/browsingdata/cookie"
	"github.com/moond4rk/hackbrowserdata/browsingdata/creditcard"
	"github.com/moond4rk/hackbrowserdata/browsingdata/download"
	"github.com/moond4rk/hackbrowserdata/browsingdata/extension"
	"github.com/moond4rk/hackbrowserdata/browsingdata/history"
	"github.com/moond4rk/hackbrowserdata/browsingdata/localstor
    
func (d *Data) Output(dir, browserName, flag string) {
	output := newOutPutter(flag)

	for _, source := range d.sources {
		if source.Len() == 0 {
			// if the length of the export data is 0, then it is not necessary to output
			continue
		}
		filename := fileutil.ItemName(browserName, source.Name(), output.Ext())

		f, err := output.CreateFile(dir, filename)
		if err != nil {
			slog.Error("create file error", "filename", filename, "err", err.Error())
			continue
		}
		if err := output.Write(source, f); err != nil {
			slog.Error("write to file error", "filename", filename, "err", err.Error())
			continue
		}
		if err := f.Close(); err != nil {
			slog.Error("close file error", "filename", filename, "err", err.Error())
			continue
		}
		slog.Warn("export success", "filename", filename)
	}
}