Skip to content

Commit

Permalink
linter fixes open-telemetry#2
Browse files Browse the repository at this point in the history
  • Loading branch information
pdelewski committed Jul 21, 2023
1 parent 040e403 commit 4a4ed1a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 7 deletions.
4 changes: 0 additions & 4 deletions instrgen/lib/callgraph.go
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,6 @@ func buildCallGraph(prog *loader.Program, file *ast.File, ginfo *types.Info,
}
}
return true

})
}

Expand Down Expand Up @@ -262,7 +261,6 @@ func DumpFuncCalls(prog *loader.Program, file *ast.File, ginfo *types.Info) {
obj.Obj().Name(), ftypeStr, position.Filename, position.Line}
fmt.Println("FuncCall:", funcCall)
}

}
}
return true
Expand All @@ -282,7 +280,6 @@ func DumpCallGraph(backwardCallGraph map[FuncDescriptor][]FuncDescriptor) {
func FindRootFunctions(prog *loader.Program, ginfo *types.Info, interfaces map[string]types.Object, allowedPathPattern string) []FuncDescriptor {
var rootFunctions []FuncDescriptor
for _, pkg := range prog.AllPackages {

//fmt.Printf("Package path %q\n", pkg.Pkg.Path())
for _, file := range pkg.Files {
if allowedPathPattern != "" && !strings.Contains(prog.Fset.Position(file.Name.Pos()).String(), allowedPathPattern) {
Expand All @@ -298,7 +295,6 @@ func FindRootFunctions(prog *loader.Program, ginfo *types.Info, interfaces map[s
func FindFuncDecls(prog *loader.Program, ginfo *types.Info, interfaces map[string]types.Object, allowedPathPattern string) FuncsInfo {
funcsInfo := makeFuncsInfo()
for _, pkg := range prog.AllPackages {

//fmt.Printf("Package path %q\n", pkg.Pkg.Path())
for _, file := range pkg.Files {
if allowedPathPattern != "" && !strings.Contains(prog.Fset.Position(file.Name.Pos()).String(), allowedPathPattern) {
Expand Down
1 change: 0 additions & 1 deletion instrgen/rewriters/otel_pruner.go
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,6 @@ func (OtelPruner) Rewrite(pkg string, file *ast.File, fset *token.FileSet, trace
astutil.DeleteNamedImport(fset, file, "__atel_context", "context")
astutil.DeleteNamedImport(fset, file, "__atel_otel", "go.opentelemetry.io/otel")
astutil.DeleteNamedImport(fset, file, "__atel_runtime", "runtime")

}

// WriteExtraFiles.
Expand Down
6 changes: 4 additions & 2 deletions instrgen/rewriters/runtime_rewriter.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ func (RuntimeRewriter) Id() string {

// Inject.
func (RuntimeRewriter) Inject(pkg string, filepath string) bool {

return pkg == "runtime"
}

Expand Down Expand Up @@ -153,6 +152,9 @@ func InstrgenSetTls(tls interface{}) {
if err != nil {
return nil
}
tlsFile.WriteString(ctxPropagation)
_, err = tlsFile.WriteString(ctxPropagation)
if err != nil {
return nil
}
return []string{destination}
}

0 comments on commit 4a4ed1a

Please sign in to comment.