From 0c30c9749ef662f3aec83db3a04f5c4f82e32d48 Mon Sep 17 00:00:00 2001 From: codeskyblue Date: Sun, 7 Apr 2024 16:23:24 +0800 Subject: [PATCH] format code --- utils.go | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/utils.go b/utils.go index 28b2d55..ff35488 100644 --- a/utils.go +++ b/utils.go @@ -286,8 +286,8 @@ func readPackageInfo(packageName string) (info PackageInfo, err error) { outbyte, err := runShell("pm", "path", packageName) lines := strings.Split(string(outbyte), "\n") if len(lines) == 0 { - err = errors.New("no output received") - return + err = errors.New("no output received") + return } output := strings.TrimSpace(lines[0]) if !strings.HasPrefix(output, "package:") { @@ -435,16 +435,17 @@ func copyToFile(rd io.Reader, dst string) error { // parse output: dumpsys meminfo --local ${pkgname} // If everything is going, returns json, unit KB -// { -// "code": 58548, -// "graphics": 73068, -// "java heap": 160332, -// "native heap": 67708, -// "private Other": 34976, -// "stack": 4728, -// "system": 8288, -// "total": 407648 -// } +// +// { +// "code": 58548, +// "graphics": 73068, +// "java heap": 160332, +// "native heap": 67708, +// "private Other": 34976, +// "stack": 4728, +// "system": 8288, +// "total": 407648 +// } func parseMemoryInfo(nameOrPid string) (info map[string]int, err error) { output, err := Command{ Args: []string{"dumpsys", "meminfo", "--local", nameOrPid},