a41f938cec
As we have seen, dependencies version can prevent the build. We should user lock versions on dependencies that we know work: * Packages are vendored * Add Godep support * Added addtional install step in readme * Fix travis build error
23 lignes
362 o
Go
23 lignes
362 o
Go
package missinggo
|
|
|
|
import (
|
|
"fmt"
|
|
"io"
|
|
"runtime"
|
|
)
|
|
|
|
func WriteStack(w io.Writer, stack []uintptr) {
|
|
for _, pc := range stack {
|
|
if pc == 0 {
|
|
break
|
|
}
|
|
pc--
|
|
f := runtime.FuncForPC(pc)
|
|
if f.Name() == "runtime.goexit" {
|
|
continue
|
|
}
|
|
file, line := f.FileLine(pc)
|
|
fmt.Fprintf(w, "# %s:\t%s:%d\n", f.Name(), file, line)
|
|
}
|
|
fmt.Fprintf(w, "\n")
|
|
}
|