File: package.html

package info (click to toggle)
golang-golang-x-tools 1%3A0.0~git20161028.0.b814a3b%2Bds-4
  • links: PTS, VCS
  • area: main
  • in suites: stretch, stretch-backports
  • size: 5,712 kB
  • ctags: 5,861
  • sloc: yacc: 155; sh: 95; makefile: 28; asm: 18; xml: 11; ansic: 10
file content (337 lines) | stat: -rw-r--r-- 10,977 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
<!--
	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.
-->
<!--
	Note: Static (i.e., not template-generated) href and id
	attributes start with "pkg-" to make it impossible for
	them to conflict with generated attributes (some of which
	correspond to Go identifiers).
-->
{{with .PDoc}}
	<script type='text/javascript'>
	document.ANALYSIS_DATA = {{$.AnalysisData}};
	document.CALLGRAPH = {{$.CallGraph}};
	</script>

	{{if $.IsMain}}
		{{/* command documentation */}}
		{{comment_html .Doc}}
	{{else}}
		{{/* package documentation */}}
		<div id="short-nav">
			<dl>
			<dd><code>import "{{html .ImportPath}}"</code></dd>
			</dl>
			<dl>
			<dd><a href="#pkg-overview" class="overviewLink">Overview</a></dd>
			<dd><a href="#pkg-index" class="indexLink">Index</a></dd>
			{{if $.Examples}}
				<dd><a href="#pkg-examples" class="examplesLink">Examples</a></dd>
			{{end}}
			{{if $.Dirs}}
				<dd><a href="#pkg-subdirectories">Subdirectories</a></dd>
			{{end}}
			</dl>
		</div>
		<!-- The package's Name is printed as title by the top-level template -->
		<div id="pkg-overview" class="toggleVisible">
			<div class="collapsed">
				<h2 class="toggleButton" title="Click to show Overview section">Overview ▹</h2>
			</div>
			<div class="expanded">
				<h2 class="toggleButton" title="Click to hide Overview section">Overview ▾</h2>
				{{comment_html .Doc}}
			</div>
		</div>
		{{example_html $ ""}}

		<div id="pkg-index" class="toggleVisible">
		<div class="collapsed">
			<h2 class="toggleButton" title="Click to show Index section">Index ▹</h2>
		</div>
		<div class="expanded">
			<h2 class="toggleButton" title="Click to hide Index section">Index ▾</h2>

		<!-- Table of contents for API; must be named manual-nav to turn off auto nav. -->
			<div id="manual-nav">
			<dl>
			{{if .Consts}}
				<dd><a href="#pkg-constants">Constants</a></dd>
			{{end}}
			{{if .Vars}}
				<dd><a href="#pkg-variables">Variables</a></dd>
			{{end}}
			{{range .Funcs}}
				{{$name_html := html .Name}}
				<dd><a href="#{{$name_html}}">{{node_html $ .Decl false | sanitize}}</a></dd>
			{{end}}
			{{range .Types}}
				{{$tname_html := html .Name}}
				<dd><a href="#{{$tname_html}}">type {{$tname_html}}</a></dd>
				{{range .Funcs}}
					{{$name_html := html .Name}}
					<dd>&nbsp; &nbsp; <a href="#{{$name_html}}">{{node_html $ .Decl false | sanitize}}</a></dd>
				{{end}}
				{{range .Methods}}
					{{$name_html := html .Name}}
					<dd>&nbsp; &nbsp; <a href="#{{$tname_html}}.{{$name_html}}">{{node_html $ .Decl false | sanitize}}</a></dd>
				{{end}}
			{{end}}
			{{if $.Notes}}
				{{range $marker, $item := $.Notes}}
				<dd><a href="#pkg-note-{{$marker}}">{{noteTitle $marker | html}}s</a></dd>
				{{end}}
			{{end}}
			</dl>
			</div><!-- #manual-nav -->

		{{if $.Examples}}
		<div id="pkg-examples">
			<h4>Examples</h4>
			<dl>
			{{range $.Examples}}
			<dd><a class="exampleLink" href="#example_{{.Name}}">{{example_name .Name}}</a></dd>
			{{end}}
			</dl>
		</div>
		{{end}}

		{{with .Filenames}}
			<h4>Package files</h4>
			<p>
			<span style="font-size:90%">
			{{range .}}
				<a href="{{.|srcLink|html}}">{{.|filename|html}}</a>
			{{end}}
			</span>
			</p>
		{{end}}
		</div><!-- .expanded -->
		</div><!-- #pkg-index -->

		<div id="pkg-callgraph" class="toggle" style="display: none">
		<div class="collapsed">
			<h2 class="toggleButton" title="Click to show Internal Call Graph section">Internal call graph ▹</h2>
		</div> <!-- .expanded -->
		<div class="expanded">
			<h2 class="toggleButton" title="Click to hide Internal Call Graph section">Internal call graph ▾</h2>
			<p>
			  In the call graph viewer below, each node
			  is a function belonging to this package
			  and its children are the functions it
			  calls&mdash;perhaps dynamically.
			</p>
			<p>
			  The root nodes are the entry points of the
			  package: functions that may be called from
			  outside the package.
			  There may be non-exported or anonymous
			  functions among them if they are called
			  dynamically from another package.
			</p>
			<p>
			  Click a node to visit that function's source code.
			  From there you can visit its callers by
			  clicking its declaring <code>func</code>
			  token.
			</p>
			<p>
			  Functions may be omitted if they were
			  determined to be unreachable in the
			  particular programs or tests that were
			  analyzed.
			</p>
			<!-- Zero means show all package entry points. -->
			<ul style="margin-left: 0.5in" id="callgraph-0" class="treeview"></ul>
		</div>
		</div> <!-- #pkg-callgraph -->

		{{with .Consts}}
			<h2 id="pkg-constants">Constants</h2>
			{{range .}}
				<pre>{{node_html $ .Decl true}}</pre>
				{{comment_html .Doc}}
			{{end}}
		{{end}}
		{{with .Vars}}
			<h2 id="pkg-variables">Variables</h2>
			{{range .}}
				<pre>{{node_html $ .Decl true}}</pre>
				{{comment_html .Doc}}
			{{end}}
		{{end}}
		{{range .Funcs}}
			{{/* Name is a string - no need for FSet */}}
			{{$name_html := html .Name}}
			<h2 id="{{$name_html}}">func <a href="{{posLink_url $ .Decl}}">{{$name_html}}</a>
				<a class="permalink" href="#{{$name_html}}">&#xb6;</a>
			</h2>
			<pre>{{node_html $ .Decl true}}</pre>
			{{comment_html .Doc}}
			{{example_html $ .Name}}
			{{callgraph_html $ "" .Name}}

		{{end}}
		{{range .Types}}
			{{$tname := .Name}}
			{{$tname_html := html .Name}}
			<h2 id="{{$tname_html}}">type <a href="{{posLink_url $ .Decl}}">{{$tname_html}}</a>
				<a class="permalink" href="#{{$tname_html}}">&#xb6;</a>
			</h2>
			<pre>{{node_html $ .Decl true}}</pre>
			{{comment_html .Doc}}

			{{range .Consts}}
				<pre>{{node_html $ .Decl true}}</pre>
				{{comment_html .Doc}}
			{{end}}

			{{range .Vars}}
				<pre>{{node_html $ .Decl true}}</pre>
				{{comment_html .Doc}}
			{{end}}

			{{example_html $ $tname}}
			{{implements_html $ $tname}}
			{{methodset_html $ $tname}}

			{{range .Funcs}}
				{{$name_html := html .Name}}
				<h3 id="{{$name_html}}">func <a href="{{posLink_url $ .Decl}}">{{$name_html}}</a>
					<a class="permalink" href="#{{$name_html}}">&#xb6;</a>
				</h3>
				<pre>{{node_html $ .Decl true}}</pre>
				{{comment_html .Doc}}
				{{example_html $ .Name}}
				{{callgraph_html $ "" .Name}}
			{{end}}

			{{range .Methods}}
				{{$name_html := html .Name}}
				<h3 id="{{$tname_html}}.{{$name_html}}">func ({{html .Recv}}) <a href="{{posLink_url $ .Decl}}">{{$name_html}}</a>
					<a class="permalink" href="#{{$tname_html}}.{{$name_html}}">&#xb6;</a>
				</h3>
				<pre>{{node_html $ .Decl true}}</pre>
				{{comment_html .Doc}}
				{{$name := printf "%s_%s" $tname .Name}}
				{{example_html $ $name}}
				{{callgraph_html $ .Recv .Name}}
			{{end}}
		{{end}}
	{{end}}

	{{with $.Notes}}
		{{range $marker, $content := .}}
			<h2 id="pkg-note-{{$marker}}">{{noteTitle $marker | html}}s</h2>
			<ul style="list-style: none; padding: 0;">
			{{range .}}
			<li><a href="{{posLink_url $ .}}" style="float: left;">&#x261e;</a> {{comment_html .Body}}</li>
			{{end}}
			</ul>
		{{end}}
	{{end}}
{{end}}

{{with .PAst}}
	{{range $filename, $ast := .}}
		<a href="{{$filename|srcLink|html}}">{{$filename|filename|html}}</a>:<pre>{{node_html $ $ast false}}</pre>
	{{end}}
{{end}}

{{with .Dirs}}
	{{/* DirList entries are numbers and strings - no need for FSet */}}
	{{if $.PDoc}}
		<h2 id="pkg-subdirectories">Subdirectories</h2>
	{{end}}
	{{if eq $.Dirname "/src"}}
		<div id="manual-nav">
			<dl>
				<dt><a href="#stdlib">Standard library</a></dt>
				<dt><a href="#other">Other packages</a></dt>
				<dd><a href="#subrepo">Sub-repositories</a></dd>
				<dd><a href="#community">Community</a></dd>
			</dl>
		</div>
		<h2 id="stdlib">Standard library</h2>
		<img class="gopher" src="/doc/gopher/pkg.png"/>
	{{end}}


	<div class="pkg-dir">
		<table>
			<tr>
				<th class="pkg-name">Name</th>
				<th class="pkg-synopsis">Synopsis</th>
			</tr>

			{{if not (or (eq $.Dirname "/src") (eq $.Dirname "/src/cmd") $.DirFlat)}}
			<tr>
				<td colspan="2"><a href="..">..</a></td>
			</tr>
			{{end}}

			{{range .List}}
				{{if $.DirFlat}}
					{{if .HasPkg}}
						<tr>
							<td class="pkg-name">
								<a href="{{html .Path}}/">{{html .Path}}</a>
							</td>
							<td class="pkg-synopsis">
								{{html .Synopsis}}
							</td>
						</tr>
					{{end}}
				{{else}}
					<tr>
						<td class="pkg-name" style="padding-left: {{multiply .Depth 20}}px;">
							<a href="{{html .Path}}/">{{html .Name}}</a>
						</td>
						<td class="pkg-synopsis">
							{{html .Synopsis}}
						</td>
					</tr>
				{{end}}
			{{end}}
		</table>
	</div>


	{{if eq $.Dirname "/src"}}
	<h2 id="other">Other packages</h2>

	<h3 id="subrepo">Sub-repositories</h3>
	<p>
	These packages are part of the Go Project but outside the main Go tree.
	They are developed under looser <a href="/doc/go1compat">compatibility requirements</a> than the Go core.
	Install them with "<a href="/cmd/go/#hdr-Download_and_install_packages_and_dependencies">go get</a>".
	</p>
	<ul>
		<li><a href="//godoc.org/golang.org/x/benchmarks">benchmarks</a> — benchmarks to measure Go as it is developed.</li>
		<li><a href="//godoc.org/golang.org/x/blog">blog</a> — <a href="//blog.golang.org">blog.golang.org</a>'s implementation.</li>
		<li><a href="//godoc.org/golang.org/x/build">build</a> — <a href="//build.golang.org">build.golang.org</a>'s implementation.</li>
		<li><a href="//godoc.org/golang.org/x/crypto">crypto</a> — additional cryptography packages.</li>
		<li><a href="//godoc.org/golang.org/x/debug">debug</a> — an experimental debugger for Go.</li>
		<li><a href="//godoc.org/golang.org/x/image">image</a> — additional imaging packages.</li>
		<li><a href="//godoc.org/golang.org/x/mobile">mobile</a> — experimental support for Go on mobile platforms.</li>
		<li><a href="//godoc.org/golang.org/x/net">net</a> — additional networking packages.</li>
		<li><a href="//godoc.org/golang.org/x/sys">sys</a> — packages for making system calls.</li>
		<li><a href="//godoc.org/golang.org/x/text">text</a> — packages for working with text.</li>
		<li><a href="//godoc.org/golang.org/x/tools">tools</a> — godoc, goimports, gorename, and other tools.</li>
		<li><a href="//godoc.org/golang.org/x/tour">tour</a> — <a href="//tour.golang.org">tour.golang.org</a>'s implementation.</li>
		<li><a href="//godoc.org/golang.org/x/exp">exp</a> — experimental and deprecated packages (handle with care; may change without warning).</li>
	</ul>

	<h3 id="community">Community</h3>
	<p>
	These services can help you find Open Source packages provided by the community.
	</p>
	<ul>
		<li><a href="//godoc.org">GoDoc</a> - a package index and search engine.</li>
		<li><a href="http://go-search.org">Go Search</a> - a code search engine.</li>
		<li><a href="/wiki/Projects">Projects at the Go Wiki</a> - a curated list of Go projects.</li>
	</ul>
	{{end}}
{{end}}