golang.org/x/tools@v0.21.1-0.20240520172518-788d39e776b1/internal/stack/gostacks/gostacks.go (about)

     1  // Copyright 2020 The Go Authors. All rights reserved.
     2  // Use of this source code is governed by a BSD-style
     3  // license that can be found in the LICENSE file.
     4  
     5  // The gostacks command processes stdin looking for things that look like
     6  // stack traces and simplifying them to make the log more readable.
     7  // It collates stack traces that have the same path as well as simplifying the
     8  // individual lines of the trace.
     9  // The processed log is printed to stdout.
    10  package main
    11  
    12  import (
    13  	"fmt"
    14  	"os"
    15  
    16  	"golang.org/x/tools/internal/stack"
    17  )
    18  
    19  func main() {
    20  	if err := stack.Process(os.Stdout, os.Stdin); err != nil {
    21  		fmt.Fprintln(os.Stderr, err)
    22  	}
    23  }