Skip to content

Commit

Permalink
Merge pull request #127 from axw/fix-goimports
Browse files Browse the repository at this point in the history
stacktrace: fixes for goimports and inlining
  • Loading branch information
axw authored Jun 27, 2018
2 parents 9918f8c + df9ddf0 commit fb3d6b5
Show file tree
Hide file tree
Showing 4 changed files with 216 additions and 198 deletions.
2 changes: 1 addition & 1 deletion error.go
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ func initStacktrace(e *Error, err error) {
for i, frame := range stackTrace {
pc[i] = uintptr(frame)
}
e.stacktrace = stacktrace.AppendCallerFrames(e.stacktrace[:0], pc)
e.stacktrace = stacktrace.AppendCallerFrames(e.stacktrace[:0], pc, -1)
}
}

Expand Down
14 changes: 11 additions & 3 deletions stacktrace/generate_library.bash
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

set -e

_PKGS=$(go list -f '{{printf "\t%q: true,\n" .ImportPath}}' "$@")
_PKGS=$(go list -f '{{printf "\t%q,\n" .ImportPath}}' "$@")

cat > library.go <<EOF
// Code generated by "go generate". DO NOT EDIT.
Expand All @@ -15,9 +15,17 @@ import (
"github.com/elastic/apm-agent-go/internal/radix"
)
var libraryPackages = radix.NewFromMap(map[string]interface{}{
var libraryPackages = newLibraryPackagesRadixTree(
$_PKGS
})
)
func newLibraryPackagesRadixTree(k ...string) *radix.Tree {
tree := radix.New()
for _, k := range k {
tree.Insert(k, true)
}
return tree
}
// RegisterLibraryPackage registers the given packages as being
// well-known library path prefixes. This must not be called
Expand Down
Loading

0 comments on commit fb3d6b5

Please sign in to comment.