mirror of
https://github.com/DataDog/go-profiler-notes.git
synced 2026-06-21 00:46:51 +08:00
19 lines
244 B
Go
19 lines
244 B
Go
package main
|
|
|
|
import (
|
|
"fmt"
|
|
"net/http"
|
|
"os"
|
|
"runtime/trace"
|
|
)
|
|
|
|
func main() {
|
|
trace.Start(os.Stderr)
|
|
defer trace.Stop()
|
|
|
|
res, err := http.Get("https://example.org/")
|
|
if err != nil {
|
|
panic(err)
|
|
}
|
|
fmt.Printf("%d\n", res.StatusCode)
|
|
}
|