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

import (
	"bytes"
	"fmt"
	"os"
	"path/filepath"

	"github.com/blacktop/go-plist"
)

// AppInfo is the Info.plist object found in .app files
// https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Introduction/Introduction.html#//apple_ref/doc/uid/TP40009248-SW1
type AppInfo 
    
func GetBinaryInApp(path string) (string, error) {
	if filepath.Ext(path) == ".app" {
		infoPath := filepath.Join(path, "Info.plist")
		if _, err := os.Stat(filepath.Join(path, "Info.plist")); err == nil { // iOS
			dat, err := os.ReadFile(infoPath)
			if err != nil {
				return "", fmt.Errorf("failed to read %s: %w", infoPath, err)
			}
			ainfo, err := ParseAppInfo(dat)
			if err != nil {
				return "", fmt.Errorf("failed to parse %s: %w", infoPath, err)
			}
			if ainfo.CFBundleExecutable != "" {
				return filepath.Join(path, ainfo.CFBundleExecutable), nil
			}
			return "", fmt.Errorf("failed to find CFBundleExecutable in %s", infoPath)
		} else if _, err := os.Stat(filepath.Join(path, "Contents", "Info.plist")); err == nil { // MacOS
			infoPath = filepath.Join(path, "Contents", "Info.plist")
			dat, err := os.ReadFile(infoPath)
			if err != nil {
				return "", fmt.Errorf("failed to read %s: %w", infoPath, err)
			}
			ainfo, err := ParseAppInfo(dat)
			if err != nil {
				return "", fmt.Errorf("failed to parse %s: %w", infoPath, err)
			}
			if ainfo.CFBundleExecutable != "" {
				return filepath.Join(path, "Contents", "MacOS", ainfo.CFBundleExecutable), nil
			}
			return "", fmt.Errorf("failed to find CFBundleExecutable in %s", infoPath)
		}
	}
	return path, fmt.Errorf("%s is not a <binary>, .app/<binary> or a .app/Contents/MacOS/<binary>", path)
}