mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2024-12-02 06:41:18 +00:00
75513575be
* store dependency's in git * since we vendor ... rm tech-depts * aad make target 'vendor' to update vendor folder (manual task)
21 lines
431 B
Go
21 lines
431 B
Go
package goblin
|
|
|
|
import (
|
|
"runtime/debug"
|
|
"strings"
|
|
)
|
|
|
|
func ResolveStack(skip int) []string {
|
|
return cleanStack(debug.Stack(), skip)
|
|
}
|
|
|
|
func cleanStack(stack []byte, skip int) []string {
|
|
arrayStack := strings.Split(string(stack), "\n")
|
|
var finalStack []string
|
|
for i := skip; i < len(arrayStack); i++ {
|
|
if strings.Contains(arrayStack[i], ".go") {
|
|
finalStack = append(finalStack, arrayStack[i])
|
|
}
|
|
}
|
|
return finalStack
|
|
}
|