Skip to content

fix:syntax error in app_endpoints.go(restapi)#717

Open
natpacket wants to merge 1 commit into
danielpaulus:mainfrom
natpacket:main
Open

fix:syntax error in app_endpoints.go(restapi)#717
natpacket wants to merge 1 commit into
danielpaulus:mainfrom
natpacket:main

Conversation

@natpacket
Copy link
Copy Markdown

When running it:

go run main.go
# github.com/danielpaulus/go-ios/restapi/api
api/app_endpoints.go:108:32: invalid operation: app.CFBundleIdentifier == bundleID (mismatched types func() string and string)
api/app_endpoints.go:109:18: cannot use app.CFBundleExecutable (value of type func() string) as string value in assignment

CFBundleIdentifier and CFBundleExecutable are functions within the AppInfo class:

func (a AppInfo) CFBundleIdentifier() string {
	if bundleId, ok := a[CFBundleIdentifier].(string); ok {
		return bundleId
	}
	return ""
}

func (a AppInfo) CFBundleName() string {
	if bundleName, ok := a[CFBundleName].(string); ok {
		return bundleName
	}
	return ""
}

but in app_endpoints.go file:
for _, app := range response {
		if app.CFBundleIdentifier == bundleID {
			processName = app.CFBundleExecutable
			break
		}
}

so change it:

for _, app := range response {
		if app.CFBundleIdentifier() == bundleID {
			processName = app.CFBundleExecutable()
			break
		}
}

It can be running well.

…xecutable are functions within the AppInfo class.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant