From c1c9f21b7e9f351eb7e8efa2df264a166b5cd82c Mon Sep 17 00:00:00 2001 From: Gaulthier Gain Date: Tue, 18 May 2021 17:08:02 +0200 Subject: [PATCH] Review code formatting Signed-off-by: Gaulthier Gain --- srcs/dependtool/parser.go | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/srcs/dependtool/parser.go b/srcs/dependtool/parser.go index 6c32ea3..bc90402 100644 --- a/srcs/dependtool/parser.go +++ b/srcs/dependtool/parser.go @@ -36,12 +36,12 @@ func parseReadELF(output string, data *u.StaticData) { if len(words) > 8 && types[words[3]] { symbol := strings.Split(words[7], "@") - if len(symbol) > 2{ - data.Symbols[symbol[0]] = symbol[1] - }else{ - data.Symbols[words[7]] = "" - } - } + if len(symbol) > 2 { + data.Symbols[symbol[0]] = symbol[1] + } else { + data.Symbols[words[7]] = "" + } + } } } @@ -222,9 +222,9 @@ func parseLDD(output string, data map[string][]string, lddMap map[string][]strin parseRecursive(rd) } else { // Associate the path if it exists - if strings.Contains(path, ".so"){ + if strings.Contains(path, ".so") { data[lib] = []string{path} - }else{ + } else { data[lib] = nil } } @@ -274,6 +274,7 @@ func detectPermissionDenied(str string) bool { } return false } + // parseTrace parses the output of the 'ftrace' command. // // It returns true if command must be run with sudo, otherwise false. @@ -312,7 +313,7 @@ func parseStrace(output string, data map[string]int) bool { // Add symbol to map if _, isSyscall := systemCalls[match[1]]; isSyscall { data[match[1]] = systemCalls[match[1]] - }else{ + } else { data[match[1]] = -1 } }