Skip to content

Commit

Permalink
Refactor: clean code for else if (#520)
Browse files Browse the repository at this point in the history
  • Loading branch information
lwangrabbit authored Dec 22, 2023
1 parent 9808da0 commit a28f3b9
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions pkg/internal/exec/proclang.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,17 @@ import (
func instrumentableFromModuleMap(moduleName string) svc.InstrumentableType {
if strings.Contains(moduleName, "libcoreclr.so") {
return svc.InstrumentableDotnet
} else if strings.Contains(moduleName, "libjvm.so") {
}
if strings.Contains(moduleName, "libjvm.so") {
return svc.InstrumentableJava
} else if strings.HasSuffix(moduleName, "/node") || moduleName == "node" {
}
if strings.HasSuffix(moduleName, "/node") || moduleName == "node" {
return svc.InstrumentableNodejs
} else if strings.HasSuffix(moduleName, "/ruby") || moduleName == "ruby" {
}
if strings.HasSuffix(moduleName, "/ruby") || moduleName == "ruby" {
return svc.InstrumentableRuby
} else if strings.Contains(moduleName, "/python") || moduleName == "python" || moduleName == "python3" {
}
if strings.Contains(moduleName, "/python") || moduleName == "python" || moduleName == "python3" {
return svc.InstrumentablePython
}

Expand All @@ -25,7 +29,8 @@ func instrumentableFromModuleMap(moduleName string) svc.InstrumentableType {
func instrumentableFromSymbolName(symbol string) svc.InstrumentableType {
if strings.Contains(symbol, "rust_panic") {
return svc.InstrumentableRust
} else if strings.HasPrefix(symbol, "JVM_") || strings.HasPrefix(symbol, "graal_") {
}
if strings.HasPrefix(symbol, "JVM_") || strings.HasPrefix(symbol, "graal_") {
return svc.InstrumentableJava
}

Expand Down

0 comments on commit a28f3b9

Please sign in to comment.