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

import (
	"strings"

	"github.com/wal-g/tracelog"
	"github.com/wal-g/wal-g/internal"
	"github.com/wal-g/wal-g/pkg/storages/storage"
	"github.com/wal-g/wal-g/utility"
)

type PermanentObject struct {
	Name        string
	StorageName string
}

func GetPermanentBackupsAndWals(folder storage.Folder) (map[PermanentObject]bool, map[PermanentObject]bool) {
	tracelog.InfoLogger.Println("retrieving permanent objects")
	backupTimes, err := internal.GetBackups(folder.GetSubFolder(utility.BaseBackupPath))
	if err != nil {
		return map[PermanentObject]bool{}, map[PermanentObject]bool{}
	}

	backupsFolder := folder.GetSubFolder(utility.BaseBackupPath)

	permanentBackups := map[PermanentObject]bool{}
	permanentWals := 
    
func GetPermanentBackupsAndWals(folder storage.Folder) (map[PermanentObject]bool, map[PermanentObject]bool) {
	tracelog.InfoLogger.Println("retrieving permanent objects")
	backupTimes, err := internal.GetBackups(folder.GetSubFolder(utility.BaseBackupPath))
	if err != nil {
		return map[PermanentObject]bool{}, map[PermanentObject]bool{}
	}

	backupsFolder := folder.GetSubFolder(utility.BaseBackupPath)

	permanentBackups := map[PermanentObject]bool{}
	permanentWals := map[PermanentObject]bool{}
	for _, backupTime := range backupTimes {
		backup, err := NewBackupInStorage(backupsFolder, backupTime.BackupName, backupTime.StorageName)
		if err != nil {
			internal.FatalOnUnrecoverableMetadataError(backupTime, err)
			continue
		}
		meta, err := backup.FetchMeta()
		if err != nil {
			internal.FatalOnUnrecoverableMetadataError(backupTime, err)
			continue
		}
		if meta.IsPermanent {
			timelineID, err := ParseTimelineFromBackupName(backup.Name)
			if err != nil {
				tracelog.ErrorLogger.Printf("failed to parse backup timeline for backup %s with error %s, ignoring...",
					backupTime.BackupName, err.Error())
				continue
			}

			startWalSegmentNo := NewWalSegmentNo(meta.StartLsn - 1)
			endWalSegmentNo := NewWalSegmentNo(meta.FinishLsn - 1)

			for walSegmentNo := startWalSegmentNo; walSegmentNo <= endWalSegmentNo; walSegmentNo = walSegmentNo.Next() {
				walObj := PermanentObject{
					Name:        walSegmentNo.GetFilename(timelineID),
					StorageName: backupTime.StorageName,
				}
				permanentWals[walObj] = true
			}
			backupObj := PermanentObject{
				Name:        backupTime.BackupName,
				StorageName: backupTime.StorageName,
			}
			permanentBackups[backupObj] = true
		}
	}
	if len(permanentBackups) > 0 {
		tracelog.InfoLogger.Printf("Found permanent objects: backups=%v, wals=%v\n",
			permanentBackups, permanentWals)
	}
	return permanentBackups, permanentWals
}