OXIESEC PANEL
- Current Dir:
/
/
opt
/
golang
/
1.19.4
/
src
/
go
/
doc
Server IP: 2a02:4780:11:1084:0:327f:3464:10
Upload:
Create Dir:
Name
Size
Modified
Perms
📁
..
-
12/01/2022 06:13:56 PM
rwxr-xr-x
📄
Makefile
246 bytes
12/01/2022 06:12:58 PM
rw-r--r--
📁
comment
-
12/01/2022 06:13:56 PM
rwxr-xr-x
📄
comment.go
1.93 KB
12/01/2022 06:12:58 PM
rw-r--r--
📄
comment_test.go
2.7 KB
12/01/2022 06:12:58 PM
rw-r--r--
📄
doc.go
11.08 KB
12/01/2022 06:12:58 PM
rw-r--r--
📄
doc_test.go
6.66 KB
12/01/2022 06:12:58 PM
rw-r--r--
📄
example.go
21.34 KB
12/01/2022 06:12:58 PM
rw-r--r--
📄
example_internal_test.go
1.64 KB
12/01/2022 06:12:58 PM
rw-r--r--
📄
example_test.go
9.62 KB
12/01/2022 06:12:58 PM
rw-r--r--
📄
exports.go
8.5 KB
12/01/2022 06:12:58 PM
rw-r--r--
📄
filter.go
2.22 KB
12/01/2022 06:12:58 PM
rw-r--r--
📄
headscan.go
2.49 KB
12/01/2022 06:12:58 PM
rw-r--r--
📄
reader.go
28.04 KB
12/01/2022 06:12:58 PM
rw-r--r--
📄
synopsis.go
2.19 KB
12/01/2022 06:12:58 PM
rw-r--r--
📄
synopsis_test.go
1.81 KB
12/01/2022 06:12:58 PM
rw-r--r--
📁
testdata
-
12/01/2022 06:13:56 PM
rwxr-xr-x
Editing: comment.go
Close
// Copyright 2009 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 doc import ( "go/doc/comment" "io" ) // ToHTML converts comment text to formatted HTML. // // Deprecated: ToHTML cannot identify documentation links // in the doc comment, because they depend on knowing what // package the text came from, which is not included in this API. // // Given the *[doc.Package] p where text was found, // ToHTML(w, text, nil) can be replaced by: // // w.Write(p.HTML(text)) // // which is in turn shorthand for: // // w.Write(p.Printer().HTML(p.Parser().Parse(text))) // // If words may be non-nil, the longer replacement is: // // parser := p.Parser() // parser.Words = words // w.Write(p.Printer().HTML(parser.Parse(d))) func ToHTML(w io.Writer, text string, words map[string]string) { p := new(Package).Parser() p.Words = words d := p.Parse(text) pr := new(comment.Printer) w.Write(pr.HTML(d)) } // ToText converts comment text to formatted text. // // Deprecated: ToText cannot identify documentation links // in the doc comment, because they depend on knowing what // package the text came from, which is not included in this API. // // Given the *[doc.Package] p where text was found, // ToText(w, text, "", "\t", 80) can be replaced by: // // w.Write(p.Text(text)) // // In the general case, ToText(w, text, prefix, codePrefix, width) // can be replaced by: // // d := p.Parser().Parse(text) // pr := p.Printer() // pr.TextPrefix = prefix // pr.TextCodePrefix = codePrefix // pr.TextWidth = width // w.Write(pr.Text(d)) // // See the documentation for [Package.Text] and [comment.Printer.Text] // for more details. func ToText(w io.Writer, text string, prefix, codePrefix string, width int) { d := new(Package).Parser().Parse(text) pr := &comment.Printer{ TextPrefix: prefix, TextCodePrefix: codePrefix, TextWidth: width, } w.Write(pr.Text(d)) }