github.com/MetalBlockchain/metalgo@v1.11.9/utils/stacktrace.go (about)

     1  // Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved.
     2  // See the file LICENSE for licensing terms.
     3  
     4  package utils
     5  
     6  import "runtime"
     7  
     8  func GetStacktrace(all bool) string {
     9  	buf := make([]byte, 1<<16)
    10  	n := runtime.Stack(buf, all)
    11  	return string(buf[:n])
    12  }