// Copyright 2023 The Go Authors. All rights reserved.// Use of this source code is governed by a BSD-style// license that can be found in the LICENSE file.package rawimport ()// TextWriter emits the text format of a trace.typeTextWriterstruct { w io.Writer v version.Version}// NewTextWriter creates a new write for the trace text format.func ( io.Writer, version.Version) (*TextWriter, error) { , := fmt.Fprintf(, "Trace Go1.%d\n", )if != nil {returnnil, }return &TextWriter{w: , v: }, nil}// WriteEvent writes a single event to the stream.func ( *TextWriter) ( Event) error {// Check version.if .Version != .v {returnfmt.Errorf("mismatched version between writer (go 1.%d) and event (go 1.%d)", .v, .Version) }// Write event. , := fmt.Fprintln(.w, .String())return}
The pages are generated with Goldsv0.7.0-preview. (GOOS=linux GOARCH=amd64)
Golds is a Go 101 project developed by Tapir Liu.
PR and bug reports are welcome and can be submitted to the issue list.
Please follow @zigo_101 (reachable from the left QR code) to get the latest news of Golds.