Skip to content
This repository has been archived by the owner on May 27, 2024. It is now read-only.

Commit

Permalink
format code
Browse files Browse the repository at this point in the history
  • Loading branch information
codeskyblue committed Apr 7, 2024
1 parent 5ca740e commit 0c30c97
Showing 1 changed file with 13 additions and 12 deletions.
25 changes: 13 additions & 12 deletions utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -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:") {
Expand Down Expand Up @@ -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},
Expand Down

0 comments on commit 0c30c97

Please sign in to comment.