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: backup.go
    path of file: ./repos/wal-g/internal/databases/mongo/archive
    
    the code of the file until where you have to start completion: package archive

import (
	"context"
	"fmt"
	"os"

	"github.com/pkg/errors"
	"github.com/wal-g/wal-g/internal"
	"github.com/wal-g/wal-g/internal/databases/mongo/client"
	"github.com/wal-g/wal-g/internal/databases/mongo/common"
	"github.com/wal-g/wal-g/internal/databases/mongo/models"
	"github.com/wal-g/wal-g/pkg/storages/storage"
	
    
func (m *MongoMetaConstructor) Finalize(backupName string) error {
	dataSize, err := internal.FolderSize(m.folder, backupName)
	if err != nil {
		return fmt.Errorf("can not get backup size: %+v", err)
	}

	lastTS, lastMajTS, err := m.client.LastWriteTS(m.ctx)
	if err != nil {
		return fmt.Errorf("can not finalize backup mongo")
	}
	m.meta.Mongo.After = models.NodeMeta{
		LastTS:    lastTS,
		LastMajTS: lastMajTS,
	}
	m.meta.BackupName = backupName
	m.meta.FinishTime = utility.TimeNowCrossPlatformLocal()
	m.meta.CompressedSize = dataSize
	return nil
}