forked from polaris1119/pkgdoc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgo_types.htm
3524 lines (1900 loc) · 246 KB
/
go_types.htm
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
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html>
<html lang="en">
<head profile="http://a9.com/-/spec/opensearch/1.1/">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="../assets/site.css" rel="stylesheet">
<title>go/types</title>
<meta name="twitter:title" content="Package types">
<meta property="og:title" content="Package types">
<meta name="description" content="Package types declares the data types and implements the algorithms for type-checking of Go packages.">
<meta name="twitter:description" content="Package types declares the data types and implements the algorithms for type-checking of Go packages.">
<meta property="og:description" content="Package types declares the data types and implements the algorithms for type-checking of Go packages.">
<meta name="twitter:card" content="summary">
<meta name="twitter:site" content="@golang">
</head>
<body>
<div class="container">
<h2 id="pkg-overview">package types</h2>
<p><code>import "go/types"</code>
<p>
Package types declares the data types and implements
the algorithms for type-checking of Go packages. Use
Config.Check to invoke the type checker for a package.
Alternatively, create a new type checker with NewChecker
and invoke it incrementally by calling Checker.Files.
</p>
<p>
Type-checking consists of several interdependent phases:
</p>
<p>
Name resolution maps each identifier (ast.Ident) in the program to the
language object (Object) it denotes.
Use Info.{Defs,Uses,Implicits} for the results of name resolution.
</p>
<p>
Constant folding computes the exact constant value (constant.Value)
for every expression (ast.Expr) that is a compile-time constant.
Use Info.Types[expr].Value for the results of constant folding.
</p>
<p>
Type inference computes the type (Type) of every expression (ast.Expr)
and checks for compliance with the language specification.
Use Info.Types[expr].Type for the results of type inference.
</p>
<p>
For a tutorial, see <a href="https://github.com/golang/go/blob/master/s/types-tutorial">https://github.com/golang/go/blob/master/s/types-tutorial</a>.</p>
<h3 id="pkg-index" class="section-header">Index <a class="permalink" href="#pkg-index">¶</a></h3>
<ul class="list-unstyled">
<li><a href="#pkg-variables">Variables</a></li>
<li><a href="#AssertableTo">func AssertableTo(V *Interface, T Type) bool</a></li><li><a href="#AssignableTo">func AssignableTo(V, T Type) bool</a></li><li><a href="#Comparable">func Comparable(T Type) bool</a></li><li><a href="#ConvertibleTo">func ConvertibleTo(V, T Type) bool</a></li><li><a href="#DefPredeclaredTestFuncs">func DefPredeclaredTestFuncs()</a></li><li><a href="#ExprString">func ExprString(x ast.Expr) string</a></li><li><a href="#Id">func Id(pkg *Package, name string) string</a></li><li><a href="#Identical">func Identical(x, y Type) bool</a></li><li><a href="#IdenticalIgnoreTags">func IdenticalIgnoreTags(x, y Type) bool</a></li><li><a href="#Implements">func Implements(V Type, T *Interface) bool</a></li><li><a href="#IsInterface">func IsInterface(typ Type) bool</a></li><li><a href="#ObjectString">func ObjectString(obj Object, qf Qualifier) string</a></li><li><a href="#SelectionString">func SelectionString(s *Selection, qf Qualifier) string</a></li><li><a href="#TypeString">func TypeString(typ Type, qf Qualifier) string</a></li><li><a href="#WriteExpr">func WriteExpr(buf *bytes.Buffer, x ast.Expr)</a></li><li><a href="#WriteSignature">func WriteSignature(buf *bytes.Buffer, sig *Signature, qf Qualifier)</a></li><li><a href="#WriteType">func WriteType(buf *bytes.Buffer, typ Type, qf Qualifier)</a></li>
<li><a href="#Array">type Array</a></li>
<ul>
<li><a href="#NewArray">func NewArray(elem Type, len int64) *Array</a></li>
<li><a href="#Array.Elem">func (a *Array) Elem() Type</a></li><li><a href="#Array.Len">func (a *Array) Len() int64</a></li><li><a href="#Array.String">func (t *Array) String() string</a></li><li><a href="#Array.Underlying">func (t *Array) Underlying() Type</a></li>
</ul>
<li><a href="#Basic">type Basic</a></li>
<ul>
<li><a href="#Basic.Info">func (b *Basic) Info() BasicInfo</a></li><li><a href="#Basic.Kind">func (b *Basic) Kind() BasicKind</a></li><li><a href="#Basic.Name">func (b *Basic) Name() string</a></li><li><a href="#Basic.String">func (t *Basic) String() string</a></li><li><a href="#Basic.Underlying">func (t *Basic) Underlying() Type</a></li>
</ul>
<li><a href="#BasicInfo">type BasicInfo</a></li>
<li><a href="#BasicKind">type BasicKind</a></li>
<li><a href="#Builtin">type Builtin</a></li>
<ul>
<li><a href="#Builtin.Exported">func (obj *Builtin) Exported() bool</a></li><li><a href="#Builtin.Id">func (obj *Builtin) Id() string</a></li><li><a href="#Builtin.Name">func (obj *Builtin) Name() string</a></li><li><a href="#Builtin.Parent">func (obj *Builtin) Parent() *Scope</a></li><li><a href="#Builtin.Pkg">func (obj *Builtin) Pkg() *Package</a></li><li><a href="#Builtin.Pos">func (obj *Builtin) Pos() token.Pos</a></li><li><a href="#Builtin.String">func (obj *Builtin) String() string</a></li><li><a href="#Builtin.Type">func (obj *Builtin) Type() Type</a></li>
</ul>
<li><a href="#Chan">type Chan</a></li>
<ul>
<li><a href="#NewChan">func NewChan(dir ChanDir, elem Type) *Chan</a></li>
<li><a href="#Chan.Dir">func (c *Chan) Dir() ChanDir</a></li><li><a href="#Chan.Elem">func (c *Chan) Elem() Type</a></li><li><a href="#Chan.String">func (t *Chan) String() string</a></li><li><a href="#Chan.Underlying">func (t *Chan) Underlying() Type</a></li>
</ul>
<li><a href="#ChanDir">type ChanDir</a></li>
<li><a href="#Checker">type Checker</a></li>
<ul>
<li><a href="#NewChecker">func NewChecker(conf *Config, fset *token.FileSet, pkg *Package, info *Info) *Checker</a></li>
<li><a href="#Checker.Files">func (check *Checker) Files(files []*ast.File) error</a></li>
</ul>
<li><a href="#Config">type Config</a></li>
<ul>
<li><a href="#Config.Check">func (conf *Config) Check(path string, fset *token.FileSet, files []*ast.File, info *Info) (*Package, error)</a></li>
</ul>
<li><a href="#Const">type Const</a></li>
<ul>
<li><a href="#NewConst">func NewConst(pos token.Pos, pkg *Package, name string, typ Type, val constant.Value) *Const</a></li>
<li><a href="#Const.Exported">func (obj *Const) Exported() bool</a></li><li><a href="#Const.Id">func (obj *Const) Id() string</a></li><li><a href="#Const.Name">func (obj *Const) Name() string</a></li><li><a href="#Const.Parent">func (obj *Const) Parent() *Scope</a></li><li><a href="#Const.Pkg">func (obj *Const) Pkg() *Package</a></li><li><a href="#Const.Pos">func (obj *Const) Pos() token.Pos</a></li><li><a href="#Const.String">func (obj *Const) String() string</a></li><li><a href="#Const.Type">func (obj *Const) Type() Type</a></li><li><a href="#Const.Val">func (obj *Const) Val() constant.Value</a></li>
</ul>
<li><a href="#Error">type Error</a></li>
<ul>
<li><a href="#Error.Error">func (err Error) Error() string</a></li>
</ul>
<li><a href="#Func">type Func</a></li>
<ul>
<li><a href="#MissingMethod">func MissingMethod(V Type, T *Interface, static bool) (method *Func, wrongType bool)</a></li><li><a href="#NewFunc">func NewFunc(pos token.Pos, pkg *Package, name string, sig *Signature) *Func</a></li>
<li><a href="#Func.Exported">func (obj *Func) Exported() bool</a></li><li><a href="#Func.FullName">func (obj *Func) FullName() string</a></li><li><a href="#Func.Id">func (obj *Func) Id() string</a></li><li><a href="#Func.Name">func (obj *Func) Name() string</a></li><li><a href="#Func.Parent">func (obj *Func) Parent() *Scope</a></li><li><a href="#Func.Pkg">func (obj *Func) Pkg() *Package</a></li><li><a href="#Func.Pos">func (obj *Func) Pos() token.Pos</a></li><li><a href="#Func.Scope">func (obj *Func) Scope() *Scope</a></li><li><a href="#Func.String">func (obj *Func) String() string</a></li><li><a href="#Func.Type">func (obj *Func) Type() Type</a></li>
</ul>
<li><a href="#ImportMode">type ImportMode</a></li>
<li><a href="#Importer">type Importer</a></li>
<li><a href="#ImporterFrom">type ImporterFrom</a></li>
<li><a href="#Info">type Info</a></li>
<ul>
<li><a href="#Info.ObjectOf">func (info *Info) ObjectOf(id *ast.Ident) Object</a></li><li><a href="#Info.TypeOf">func (info *Info) TypeOf(e ast.Expr) Type</a></li>
</ul>
<li><a href="#Initializer">type Initializer</a></li>
<ul>
<li><a href="#Initializer.String">func (init *Initializer) String() string</a></li>
</ul>
<li><a href="#Interface">type Interface</a></li>
<ul>
<li><a href="#NewInterface">func NewInterface(methods []*Func, embeddeds []*Named) *Interface</a></li>
<li><a href="#Interface.Complete">func (t *Interface) Complete() *Interface</a></li><li><a href="#Interface.Embedded">func (t *Interface) Embedded(i int) *Named</a></li><li><a href="#Interface.Empty">func (t *Interface) Empty() bool</a></li><li><a href="#Interface.ExplicitMethod">func (t *Interface) ExplicitMethod(i int) *Func</a></li><li><a href="#Interface.Method">func (t *Interface) Method(i int) *Func</a></li><li><a href="#Interface.NumEmbeddeds">func (t *Interface) NumEmbeddeds() int</a></li><li><a href="#Interface.NumExplicitMethods">func (t *Interface) NumExplicitMethods() int</a></li><li><a href="#Interface.NumMethods">func (t *Interface) NumMethods() int</a></li><li><a href="#Interface.String">func (t *Interface) String() string</a></li><li><a href="#Interface.Underlying">func (t *Interface) Underlying() Type</a></li>
</ul>
<li><a href="#Label">type Label</a></li>
<ul>
<li><a href="#NewLabel">func NewLabel(pos token.Pos, pkg *Package, name string) *Label</a></li>
<li><a href="#Label.Exported">func (obj *Label) Exported() bool</a></li><li><a href="#Label.Id">func (obj *Label) Id() string</a></li><li><a href="#Label.Name">func (obj *Label) Name() string</a></li><li><a href="#Label.Parent">func (obj *Label) Parent() *Scope</a></li><li><a href="#Label.Pkg">func (obj *Label) Pkg() *Package</a></li><li><a href="#Label.Pos">func (obj *Label) Pos() token.Pos</a></li><li><a href="#Label.String">func (obj *Label) String() string</a></li><li><a href="#Label.Type">func (obj *Label) Type() Type</a></li>
</ul>
<li><a href="#Map">type Map</a></li>
<ul>
<li><a href="#NewMap">func NewMap(key, elem Type) *Map</a></li>
<li><a href="#Map.Elem">func (m *Map) Elem() Type</a></li><li><a href="#Map.Key">func (m *Map) Key() Type</a></li><li><a href="#Map.String">func (t *Map) String() string</a></li><li><a href="#Map.Underlying">func (t *Map) Underlying() Type</a></li>
</ul>
<li><a href="#MethodSet">type MethodSet</a></li>
<ul>
<li><a href="#NewMethodSet">func NewMethodSet(T Type) *MethodSet</a></li>
<li><a href="#MethodSet.At">func (s *MethodSet) At(i int) *Selection</a></li><li><a href="#MethodSet.Len">func (s *MethodSet) Len() int</a></li><li><a href="#MethodSet.Lookup">func (s *MethodSet) Lookup(pkg *Package, name string) *Selection</a></li><li><a href="#MethodSet.String">func (s *MethodSet) String() string</a></li>
</ul>
<li><a href="#Named">type Named</a></li>
<ul>
<li><a href="#NewNamed">func NewNamed(obj *TypeName, underlying Type, methods []*Func) *Named</a></li>
<li><a href="#Named.AddMethod">func (t *Named) AddMethod(m *Func)</a></li><li><a href="#Named.Method">func (t *Named) Method(i int) *Func</a></li><li><a href="#Named.NumMethods">func (t *Named) NumMethods() int</a></li><li><a href="#Named.Obj">func (t *Named) Obj() *TypeName</a></li><li><a href="#Named.SetUnderlying">func (t *Named) SetUnderlying(underlying Type)</a></li><li><a href="#Named.String">func (t *Named) String() string</a></li><li><a href="#Named.Underlying">func (t *Named) Underlying() Type</a></li>
</ul>
<li><a href="#Nil">type Nil</a></li>
<ul>
<li><a href="#Nil.Exported">func (obj *Nil) Exported() bool</a></li><li><a href="#Nil.Id">func (obj *Nil) Id() string</a></li><li><a href="#Nil.Name">func (obj *Nil) Name() string</a></li><li><a href="#Nil.Parent">func (obj *Nil) Parent() *Scope</a></li><li><a href="#Nil.Pkg">func (obj *Nil) Pkg() *Package</a></li><li><a href="#Nil.Pos">func (obj *Nil) Pos() token.Pos</a></li><li><a href="#Nil.String">func (obj *Nil) String() string</a></li><li><a href="#Nil.Type">func (obj *Nil) Type() Type</a></li>
</ul>
<li><a href="#Object">type Object</a></li>
<ul>
<li><a href="#LookupFieldOrMethod">func LookupFieldOrMethod(T Type, addressable bool, pkg *Package, name string) (obj Object, index []int, indirect bool)</a></li>
</ul>
<li><a href="#Package">type Package</a></li>
<ul>
<li><a href="#NewPackage">func NewPackage(path, name string) *Package</a></li>
<li><a href="#Package.Complete">func (pkg *Package) Complete() bool</a></li><li><a href="#Package.Imports">func (pkg *Package) Imports() []*Package</a></li><li><a href="#Package.MarkComplete">func (pkg *Package) MarkComplete()</a></li><li><a href="#Package.Name">func (pkg *Package) Name() string</a></li><li><a href="#Package.Path">func (pkg *Package) Path() string</a></li><li><a href="#Package.Scope">func (pkg *Package) Scope() *Scope</a></li><li><a href="#Package.SetImports">func (pkg *Package) SetImports(list []*Package)</a></li><li><a href="#Package.SetName">func (pkg *Package) SetName(name string)</a></li><li><a href="#Package.String">func (pkg *Package) String() string</a></li>
</ul>
<li><a href="#PkgName">type PkgName</a></li>
<ul>
<li><a href="#NewPkgName">func NewPkgName(pos token.Pos, pkg *Package, name string, imported *Package) *PkgName</a></li>
<li><a href="#PkgName.Exported">func (obj *PkgName) Exported() bool</a></li><li><a href="#PkgName.Id">func (obj *PkgName) Id() string</a></li><li><a href="#PkgName.Imported">func (obj *PkgName) Imported() *Package</a></li><li><a href="#PkgName.Name">func (obj *PkgName) Name() string</a></li><li><a href="#PkgName.Parent">func (obj *PkgName) Parent() *Scope</a></li><li><a href="#PkgName.Pkg">func (obj *PkgName) Pkg() *Package</a></li><li><a href="#PkgName.Pos">func (obj *PkgName) Pos() token.Pos</a></li><li><a href="#PkgName.String">func (obj *PkgName) String() string</a></li><li><a href="#PkgName.Type">func (obj *PkgName) Type() Type</a></li>
</ul>
<li><a href="#Pointer">type Pointer</a></li>
<ul>
<li><a href="#NewPointer">func NewPointer(elem Type) *Pointer</a></li>
<li><a href="#Pointer.Elem">func (p *Pointer) Elem() Type</a></li><li><a href="#Pointer.String">func (t *Pointer) String() string</a></li><li><a href="#Pointer.Underlying">func (t *Pointer) Underlying() Type</a></li>
</ul>
<li><a href="#Qualifier">type Qualifier</a></li>
<ul>
<li><a href="#RelativeTo">func RelativeTo(pkg *Package) Qualifier</a></li>
</ul>
<li><a href="#Scope">type Scope</a></li>
<ul>
<li><a href="#NewScope">func NewScope(parent *Scope, pos, end token.Pos, comment string) *Scope</a></li>
<li><a href="#Scope.Child">func (s *Scope) Child(i int) *Scope</a></li><li><a href="#Scope.Contains">func (s *Scope) Contains(pos token.Pos) bool</a></li><li><a href="#Scope.End">func (s *Scope) End() token.Pos</a></li><li><a href="#Scope.Innermost">func (s *Scope) Innermost(pos token.Pos) *Scope</a></li><li><a href="#Scope.Insert">func (s *Scope) Insert(obj Object) Object</a></li><li><a href="#Scope.Len">func (s *Scope) Len() int</a></li><li><a href="#Scope.Lookup">func (s *Scope) Lookup(name string) Object</a></li><li><a href="#Scope.LookupParent">func (s *Scope) LookupParent(name string, pos token.Pos) (*Scope, Object)</a></li><li><a href="#Scope.Names">func (s *Scope) Names() []string</a></li><li><a href="#Scope.NumChildren">func (s *Scope) NumChildren() int</a></li><li><a href="#Scope.Parent">func (s *Scope) Parent() *Scope</a></li><li><a href="#Scope.Pos">func (s *Scope) Pos() token.Pos</a></li><li><a href="#Scope.String">func (s *Scope) String() string</a></li><li><a href="#Scope.WriteTo">func (s *Scope) WriteTo(w io.Writer, n int, recurse bool)</a></li>
</ul>
<li><a href="#Selection">type Selection</a></li>
<ul>
<li><a href="#Selection.Index">func (s *Selection) Index() []int</a></li><li><a href="#Selection.Indirect">func (s *Selection) Indirect() bool</a></li><li><a href="#Selection.Kind">func (s *Selection) Kind() SelectionKind</a></li><li><a href="#Selection.Obj">func (s *Selection) Obj() Object</a></li><li><a href="#Selection.Recv">func (s *Selection) Recv() Type</a></li><li><a href="#Selection.String">func (s *Selection) String() string</a></li><li><a href="#Selection.Type">func (s *Selection) Type() Type</a></li>
</ul>
<li><a href="#SelectionKind">type SelectionKind</a></li>
<li><a href="#Signature">type Signature</a></li>
<ul>
<li><a href="#NewSignature">func NewSignature(recv *Var, params, results *Tuple, variadic bool) *Signature</a></li>
<li><a href="#Signature.Params">func (s *Signature) Params() *Tuple</a></li><li><a href="#Signature.Recv">func (s *Signature) Recv() *Var</a></li><li><a href="#Signature.Results">func (s *Signature) Results() *Tuple</a></li><li><a href="#Signature.String">func (t *Signature) String() string</a></li><li><a href="#Signature.Underlying">func (t *Signature) Underlying() Type</a></li><li><a href="#Signature.Variadic">func (s *Signature) Variadic() bool</a></li>
</ul>
<li><a href="#Sizes">type Sizes</a></li>
<li><a href="#Slice">type Slice</a></li>
<ul>
<li><a href="#NewSlice">func NewSlice(elem Type) *Slice</a></li>
<li><a href="#Slice.Elem">func (s *Slice) Elem() Type</a></li><li><a href="#Slice.String">func (t *Slice) String() string</a></li><li><a href="#Slice.Underlying">func (t *Slice) Underlying() Type</a></li>
</ul>
<li><a href="#StdSizes">type StdSizes</a></li>
<ul>
<li><a href="#StdSizes.Alignof">func (s *StdSizes) Alignof(T Type) int64</a></li><li><a href="#StdSizes.Offsetsof">func (s *StdSizes) Offsetsof(fields []*Var) []int64</a></li><li><a href="#StdSizes.Sizeof">func (s *StdSizes) Sizeof(T Type) int64</a></li>
</ul>
<li><a href="#Struct">type Struct</a></li>
<ul>
<li><a href="#NewStruct">func NewStruct(fields []*Var, tags []string) *Struct</a></li>
<li><a href="#Struct.Field">func (s *Struct) Field(i int) *Var</a></li><li><a href="#Struct.NumFields">func (s *Struct) NumFields() int</a></li><li><a href="#Struct.String">func (t *Struct) String() string</a></li><li><a href="#Struct.Tag">func (s *Struct) Tag(i int) string</a></li><li><a href="#Struct.Underlying">func (t *Struct) Underlying() Type</a></li>
</ul>
<li><a href="#Tuple">type Tuple</a></li>
<ul>
<li><a href="#NewTuple">func NewTuple(x ...*Var) *Tuple</a></li>
<li><a href="#Tuple.At">func (t *Tuple) At(i int) *Var</a></li><li><a href="#Tuple.Len">func (t *Tuple) Len() int</a></li><li><a href="#Tuple.String">func (t *Tuple) String() string</a></li><li><a href="#Tuple.Underlying">func (t *Tuple) Underlying() Type</a></li>
</ul>
<li><a href="#Type">type Type</a></li>
<ul>
<li><a href="#Default">func Default(typ Type) Type</a></li>
</ul>
<li><a href="#TypeAndValue">type TypeAndValue</a></li>
<ul>
<li><a href="#Eval">func Eval(fset *token.FileSet, pkg *Package, pos token.Pos, expr string) (TypeAndValue, error)</a></li>
<li><a href="#TypeAndValue.Addressable">func (tv TypeAndValue) Addressable() bool</a></li><li><a href="#TypeAndValue.Assignable">func (tv TypeAndValue) Assignable() bool</a></li><li><a href="#TypeAndValue.HasOk">func (tv TypeAndValue) HasOk() bool</a></li><li><a href="#TypeAndValue.IsBuiltin">func (tv TypeAndValue) IsBuiltin() bool</a></li><li><a href="#TypeAndValue.IsNil">func (tv TypeAndValue) IsNil() bool</a></li><li><a href="#TypeAndValue.IsType">func (tv TypeAndValue) IsType() bool</a></li><li><a href="#TypeAndValue.IsValue">func (tv TypeAndValue) IsValue() bool</a></li><li><a href="#TypeAndValue.IsVoid">func (tv TypeAndValue) IsVoid() bool</a></li>
</ul>
<li><a href="#TypeName">type TypeName</a></li>
<ul>
<li><a href="#NewTypeName">func NewTypeName(pos token.Pos, pkg *Package, name string, typ Type) *TypeName</a></li>
<li><a href="#TypeName.Exported">func (obj *TypeName) Exported() bool</a></li><li><a href="#TypeName.Id">func (obj *TypeName) Id() string</a></li><li><a href="#TypeName.Name">func (obj *TypeName) Name() string</a></li><li><a href="#TypeName.Parent">func (obj *TypeName) Parent() *Scope</a></li><li><a href="#TypeName.Pkg">func (obj *TypeName) Pkg() *Package</a></li><li><a href="#TypeName.Pos">func (obj *TypeName) Pos() token.Pos</a></li><li><a href="#TypeName.String">func (obj *TypeName) String() string</a></li><li><a href="#TypeName.Type">func (obj *TypeName) Type() Type</a></li>
</ul>
<li><a href="#Var">type Var</a></li>
<ul>
<li><a href="#NewField">func NewField(pos token.Pos, pkg *Package, name string, typ Type, anonymous bool) *Var</a></li><li><a href="#NewParam">func NewParam(pos token.Pos, pkg *Package, name string, typ Type) *Var</a></li><li><a href="#NewVar">func NewVar(pos token.Pos, pkg *Package, name string, typ Type) *Var</a></li>
<li><a href="#Var.Anonymous">func (obj *Var) Anonymous() bool</a></li><li><a href="#Var.Exported">func (obj *Var) Exported() bool</a></li><li><a href="#Var.Id">func (obj *Var) Id() string</a></li><li><a href="#Var.IsField">func (obj *Var) IsField() bool</a></li><li><a href="#Var.Name">func (obj *Var) Name() string</a></li><li><a href="#Var.Parent">func (obj *Var) Parent() *Scope</a></li><li><a href="#Var.Pkg">func (obj *Var) Pkg() *Package</a></li><li><a href="#Var.Pos">func (obj *Var) Pos() token.Pos</a></li><li><a href="#Var.String">func (obj *Var) String() string</a></li><li><a href="#Var.Type">func (obj *Var) Type() Type</a></li>
</ul>
</ul>
<h4 id="pkg-examples">Examples <a class="permalink" href="#pkg-examples">¶</a></h4>
<ul class="list-unstyled">
<li><a href="#example-Info" onclick="$('#ex-Info').addClass('in').removeClass('collapse').height('auto')">Info</a></li><li><a href="#example-MethodSet" onclick="$('#ex-MethodSet').addClass('in').removeClass('collapse').height('auto')">MethodSet</a></li><li><a href="#example-Scope" onclick="$('#ex-Scope').addClass('in').removeClass('collapse').height('auto')">Scope</a></li>
</ul>
<h4 id="pkg-files">
<a href="https://github.com/golang/go/blob/master/src/go/types/">Package Files</a>
<a class="permalink" href="#pkg-files">¶</a>
</h4>
<p><a href="https://github.com/golang/go/blob/master/src/go/types/api.go">api.go</a> <a href="https://github.com/golang/go/blob/master/src/go/types/assignments.go">assignments.go</a> <a href="https://github.com/golang/go/blob/master/src/go/types/builtins.go">builtins.go</a> <a href="https://github.com/golang/go/blob/master/src/go/types/call.go">call.go</a> <a href="https://github.com/golang/go/blob/master/src/go/types/check.go">check.go</a> <a href="https://github.com/golang/go/blob/master/src/go/types/conversions.go">conversions.go</a> <a href="https://github.com/golang/go/blob/master/src/go/types/decl.go">decl.go</a> <a href="https://github.com/golang/go/blob/master/src/go/types/errors.go">errors.go</a> <a href="https://github.com/golang/go/blob/master/src/go/types/eval.go">eval.go</a> <a href="https://github.com/golang/go/blob/master/src/go/types/expr.go">expr.go</a> <a href="https://github.com/golang/go/blob/master/src/go/types/exprstring.go">exprstring.go</a> <a href="https://github.com/golang/go/blob/master/src/go/types/initorder.go">initorder.go</a> <a href="https://github.com/golang/go/blob/master/src/go/types/labels.go">labels.go</a> <a href="https://github.com/golang/go/blob/master/src/go/types/lookup.go">lookup.go</a> <a href="https://github.com/golang/go/blob/master/src/go/types/methodset.go">methodset.go</a> <a href="https://github.com/golang/go/blob/master/src/go/types/object.go">object.go</a> <a href="https://github.com/golang/go/blob/master/src/go/types/objset.go">objset.go</a> <a href="https://github.com/golang/go/blob/master/src/go/types/operand.go">operand.go</a> <a href="https://github.com/golang/go/blob/master/src/go/types/ordering.go">ordering.go</a> <a href="https://github.com/golang/go/blob/master/src/go/types/package.go">package.go</a> <a href="https://github.com/golang/go/blob/master/src/go/types/predicates.go">predicates.go</a> <a href="https://github.com/golang/go/blob/master/src/go/types/resolver.go">resolver.go</a> <a href="https://github.com/golang/go/blob/master/src/go/types/return.go">return.go</a> <a href="https://github.com/golang/go/blob/master/src/go/types/scope.go">scope.go</a> <a href="https://github.com/golang/go/blob/master/src/go/types/selection.go">selection.go</a> <a href="https://github.com/golang/go/blob/master/src/go/types/sizes.go">sizes.go</a> <a href="https://github.com/golang/go/blob/master/src/go/types/stmt.go">stmt.go</a> <a href="https://github.com/golang/go/blob/master/src/go/types/type.go">type.go</a> <a href="https://github.com/golang/go/blob/master/src/go/types/typestring.go">typestring.go</a> <a href="https://github.com/golang/go/blob/master/src/go/types/typexpr.go">typexpr.go</a> <a href="https://github.com/golang/go/blob/master/src/go/types/universe.go">universe.go</a> </p>
<h3 id="pkg-variables">Variables <a class="permalink" href="#pkg-variables">¶</a></h3>
<div class="decl" data-kind="v"><a title="View Source" href="https://github.com/golang/go/blob/master/src/go/types/universe.go#L15">❖</a><pre>var (
<span id="Universe">Universe</span> *<a href="#Scope">Scope</a>
<span id="Unsafe">Unsafe</span> *<a href="#Package">Package</a>
)</pre></div><div class="decl" data-kind="v"><a title="View Source" href="https://github.com/golang/go/blob/master/src/go/types/universe.go#L23">❖</a><pre>var <span id="Typ">Typ</span> = []*<a href="#Basic">Basic</a>{
Invalid: {<a href="#Invalid">Invalid</a>, 0, "invalid type"},
Bool: {<a href="#Bool">Bool</a>, <a href="#IsBoolean">IsBoolean</a>, "bool"},
Int: {<a href="#Int">Int</a>, <a href="#IsInteger">IsInteger</a>, "int"},
Int8: {<a href="#Int8">Int8</a>, <a href="#IsInteger">IsInteger</a>, "int8"},
Int16: {<a href="#Int16">Int16</a>, <a href="#IsInteger">IsInteger</a>, "int16"},
Int32: {<a href="#Int32">Int32</a>, <a href="#IsInteger">IsInteger</a>, "int32"},
Int64: {<a href="#Int64">Int64</a>, <a href="#IsInteger">IsInteger</a>, "int64"},
Uint: {<a href="#Uint">Uint</a>, <a href="#IsInteger">IsInteger</a> | <a href="#IsUnsigned">IsUnsigned</a>, "uint"},
Uint8: {<a href="#Uint8">Uint8</a>, <a href="#IsInteger">IsInteger</a> | <a href="#IsUnsigned">IsUnsigned</a>, "uint8"},
Uint16: {<a href="#Uint16">Uint16</a>, <a href="#IsInteger">IsInteger</a> | <a href="#IsUnsigned">IsUnsigned</a>, "uint16"},
Uint32: {<a href="#Uint32">Uint32</a>, <a href="#IsInteger">IsInteger</a> | <a href="#IsUnsigned">IsUnsigned</a>, "uint32"},
Uint64: {<a href="#Uint64">Uint64</a>, <a href="#IsInteger">IsInteger</a> | <a href="#IsUnsigned">IsUnsigned</a>, "uint64"},
Uintptr: {<a href="#Uintptr">Uintptr</a>, <a href="#IsInteger">IsInteger</a> | <a href="#IsUnsigned">IsUnsigned</a>, "uintptr"},
Float32: {<a href="#Float32">Float32</a>, <a href="#IsFloat">IsFloat</a>, "float32"},
Float64: {<a href="#Float64">Float64</a>, <a href="#IsFloat">IsFloat</a>, "float64"},
Complex64: {<a href="#Complex64">Complex64</a>, <a href="#IsComplex">IsComplex</a>, "complex64"},
Complex128: {<a href="#Complex128">Complex128</a>, <a href="#IsComplex">IsComplex</a>, "complex128"},
String: {<a href="#String">String</a>, <a href="#IsString">IsString</a>, "string"},
UnsafePointer: {<a href="#UnsafePointer">UnsafePointer</a>, 0, "Pointer"},
UntypedBool: {<a href="#UntypedBool">UntypedBool</a>, <a href="#IsBoolean">IsBoolean</a> | <a href="#IsUntyped">IsUntyped</a>, "untyped bool"},
UntypedInt: {<a href="#UntypedInt">UntypedInt</a>, <a href="#IsInteger">IsInteger</a> | <a href="#IsUntyped">IsUntyped</a>, "untyped int"},
UntypedRune: {<a href="#UntypedRune">UntypedRune</a>, <a href="#IsInteger">IsInteger</a> | <a href="#IsUntyped">IsUntyped</a>, "untyped rune"},
UntypedFloat: {<a href="#UntypedFloat">UntypedFloat</a>, <a href="#IsFloat">IsFloat</a> | <a href="#IsUntyped">IsUntyped</a>, "untyped float"},
UntypedComplex: {<a href="#UntypedComplex">UntypedComplex</a>, <a href="#IsComplex">IsComplex</a> | <a href="#IsUntyped">IsUntyped</a>, "untyped complex"},
UntypedString: {<a href="#UntypedString">UntypedString</a>, <a href="#IsString">IsString</a> | <a href="#IsUntyped">IsUntyped</a>, "untyped string"},
UntypedNil: {<a href="#UntypedNil">UntypedNil</a>, <a href="#IsUntyped">IsUntyped</a>, "untyped nil"},
}</pre></div>
<h3 id="AssertableTo" data-kind="f">func <a title="View Source" href="https://github.com/golang/go/blob/master/src/go/types/api.go#L353">AssertableTo</a> <a class="permalink" href="#AssertableTo">¶</a> <a class="uses" title="List Function Callers" href="https://sourcegraph.com/-/godoc/refs?def=AssertableTo&pkg=go%2Ftypes&repo=">Uses</a></h3>
<div class="funcdecl decl"><a title="View Source" href="https://github.com/golang/go/blob/master/src/go/types/api.go#L353">❖</a><pre>func AssertableTo(V *<a href="#Interface">Interface</a>, T <a href="#Type">Type</a>) <a href="/builtin#bool">bool</a></pre></div><p>
AssertableTo reports whether a value of type V can be asserted to have type T.
</p>
<h3 id="AssignableTo" data-kind="f">func <a title="View Source" href="https://github.com/golang/go/blob/master/src/go/types/api.go#L359">AssignableTo</a> <a class="permalink" href="#AssignableTo">¶</a> <a class="uses" title="List Function Callers" href="https://sourcegraph.com/-/godoc/refs?def=AssignableTo&pkg=go%2Ftypes&repo=">Uses</a></h3>
<div class="funcdecl decl"><a title="View Source" href="https://github.com/golang/go/blob/master/src/go/types/api.go#L359">❖</a><pre>func AssignableTo(V, T <a href="#Type">Type</a>) <a href="/builtin#bool">bool</a></pre></div><p>
AssignableTo reports whether a value of type V is assignable to a variable of type T.
</p>
<h3 id="Comparable" data-kind="f">func <a title="View Source" href="https://github.com/golang/go/blob/master/src/go/types/predicates.go#L81">Comparable</a> <a class="permalink" href="#Comparable">¶</a> <a class="uses" title="List Function Callers" href="https://sourcegraph.com/-/godoc/refs?def=Comparable&pkg=go%2Ftypes&repo=">Uses</a></h3>
<div class="funcdecl decl"><a title="View Source" href="https://github.com/golang/go/blob/master/src/go/types/predicates.go#L81">❖</a><pre>func Comparable(T <a href="#Type">Type</a>) <a href="/builtin#bool">bool</a></pre></div><p>
Comparable reports whether values of type T are comparable.
</p>
<h3 id="ConvertibleTo" data-kind="f">func <a title="View Source" href="https://github.com/golang/go/blob/master/src/go/types/api.go#L365">ConvertibleTo</a> <a class="permalink" href="#ConvertibleTo">¶</a> <a class="uses" title="List Function Callers" href="https://sourcegraph.com/-/godoc/refs?def=ConvertibleTo&pkg=go%2Ftypes&repo=">Uses</a></h3>
<div class="funcdecl decl"><a title="View Source" href="https://github.com/golang/go/blob/master/src/go/types/api.go#L365">❖</a><pre>func ConvertibleTo(V, T <a href="#Type">Type</a>) <a href="/builtin#bool">bool</a></pre></div><p>
ConvertibleTo reports whether a value of type V is convertible to a value of type T.
</p>
<h3 id="DefPredeclaredTestFuncs" data-kind="f">func <a title="View Source" href="https://github.com/golang/go/blob/master/src/go/types/universe.go#L170">DefPredeclaredTestFuncs</a> <a class="permalink" href="#DefPredeclaredTestFuncs">¶</a> <a class="uses" title="List Function Callers" href="https://sourcegraph.com/-/godoc/refs?def=DefPredeclaredTestFuncs&pkg=go%2Ftypes&repo=">Uses</a></h3>
<div class="funcdecl decl"><a title="View Source" href="https://github.com/golang/go/blob/master/src/go/types/universe.go#L170">❖</a><pre>func DefPredeclaredTestFuncs()</pre></div><p>
DefPredeclaredTestFuncs defines the assert and trace built-ins.
These built-ins are intended for debugging and testing of this
package only.
</p>
<h3 id="ExprString" data-kind="f">func <a title="View Source" href="https://github.com/golang/go/blob/master/src/go/types/exprstring.go#L15">ExprString</a> <a class="permalink" href="#ExprString">¶</a> <a class="uses" title="List Function Callers" href="https://sourcegraph.com/-/godoc/refs?def=ExprString&pkg=go%2Ftypes&repo=">Uses</a></h3>
<div class="funcdecl decl"><a title="View Source" href="https://github.com/golang/go/blob/master/src/go/types/exprstring.go#L15">❖</a><pre>func ExprString(x <a href="/go/ast">ast</a>.<a href="/go/ast#Expr">Expr</a>) <a href="/builtin#string">string</a></pre></div><p>
ExprString returns the (possibly simplified) string representation for x.
</p>
<h3 id="Id" data-kind="f">func <a title="View Source" href="https://github.com/golang/go/blob/master/src/go/types/object.go#L57">Id</a> <a class="permalink" href="#Id">¶</a> <a class="uses" title="List Function Callers" href="https://sourcegraph.com/-/godoc/refs?def=Id&pkg=go%2Ftypes&repo=">Uses</a></h3>
<div class="funcdecl decl"><a title="View Source" href="https://github.com/golang/go/blob/master/src/go/types/object.go#L57">❖</a><pre>func Id(pkg *<a href="#Package">Package</a>, name <a href="/builtin#string">string</a>) <a href="/builtin#string">string</a></pre></div><p>
Id returns name if it is exported, otherwise it
returns the name qualified with the package <a href="/path">path</a>.
</p>
<h3 id="Identical" data-kind="f">func <a title="View Source" href="https://github.com/golang/go/blob/master/src/go/types/predicates.go#L114">Identical</a> <a class="permalink" href="#Identical">¶</a> <a class="uses" title="List Function Callers" href="https://sourcegraph.com/-/godoc/refs?def=Identical&pkg=go%2Ftypes&repo=">Uses</a></h3>
<div class="funcdecl decl"><a title="View Source" href="https://github.com/golang/go/blob/master/src/go/types/predicates.go#L114">❖</a><pre>func Identical(x, y <a href="#Type">Type</a>) <a href="/builtin#bool">bool</a></pre></div><p>
Identical reports whether x and y are identical.
</p>
<h3 id="IdenticalIgnoreTags" data-kind="f">func <a title="View Source" href="https://github.com/golang/go/blob/master/src/go/types/predicates.go#L119">IdenticalIgnoreTags</a> <a class="permalink" href="#IdenticalIgnoreTags">¶</a> <a class="uses" title="List Function Callers" href="https://sourcegraph.com/-/godoc/refs?def=IdenticalIgnoreTags&pkg=go%2Ftypes&repo=">Uses</a></h3>
<div class="funcdecl decl"><a title="View Source" href="https://github.com/golang/go/blob/master/src/go/types/predicates.go#L119">❖</a><pre>func IdenticalIgnoreTags(x, y <a href="#Type">Type</a>) <a href="/builtin#bool">bool</a></pre></div><p>
IdenticalIgnoreTags reports whether x and y are identical if tags are ignored.
</p>
<h3 id="Implements" data-kind="f">func <a title="View Source" href="https://github.com/golang/go/blob/master/src/go/types/api.go#L371">Implements</a> <a class="permalink" href="#Implements">¶</a> <a class="uses" title="List Function Callers" href="https://sourcegraph.com/-/godoc/refs?def=Implements&pkg=go%2Ftypes&repo=">Uses</a></h3>
<div class="funcdecl decl"><a title="View Source" href="https://github.com/golang/go/blob/master/src/go/types/api.go#L371">❖</a><pre>func Implements(V <a href="#Type">Type</a>, T *<a href="#Interface">Interface</a>) <a href="/builtin#bool">bool</a></pre></div><p>
Implements reports whether type V implements interface T.
</p>
<h3 id="IsInterface" data-kind="f">func <a title="View Source" href="https://github.com/golang/go/blob/master/src/go/types/predicates.go#L75">IsInterface</a> <a class="permalink" href="#IsInterface">¶</a> <a class="uses" title="List Function Callers" href="https://sourcegraph.com/-/godoc/refs?def=IsInterface&pkg=go%2Ftypes&repo=">Uses</a></h3>
<div class="funcdecl decl"><a title="View Source" href="https://github.com/golang/go/blob/master/src/go/types/predicates.go#L75">❖</a><pre>func IsInterface(typ <a href="#Type">Type</a>) <a href="/builtin#bool">bool</a></pre></div><p>
IsInterface reports whether typ is an interface type.
</p>
<h3 id="ObjectString" data-kind="f">func <a title="View Source" href="https://github.com/golang/go/blob/master/src/go/types/object.go#L350">ObjectString</a> <a class="permalink" href="#ObjectString">¶</a> <a class="uses" title="List Function Callers" href="https://sourcegraph.com/-/godoc/refs?def=ObjectString&pkg=go%2Ftypes&repo=">Uses</a></h3>
<div class="funcdecl decl"><a title="View Source" href="https://github.com/golang/go/blob/master/src/go/types/object.go#L350">❖</a><pre>func ObjectString(obj <a href="#Object">Object</a>, qf <a href="#Qualifier">Qualifier</a>) <a href="/builtin#string">string</a></pre></div><p>
ObjectString returns the string form of obj.
The Qualifier controls the printing of
package-level objects, and may be nil.
</p>
<h3 id="SelectionString" data-kind="f">func <a title="View Source" href="https://github.com/golang/go/blob/master/src/go/types/selection.go#L119">SelectionString</a> <a class="permalink" href="#SelectionString">¶</a> <a class="uses" title="List Function Callers" href="https://sourcegraph.com/-/godoc/refs?def=SelectionString&pkg=go%2Ftypes&repo=">Uses</a></h3>
<div class="funcdecl decl"><a title="View Source" href="https://github.com/golang/go/blob/master/src/go/types/selection.go#L119">❖</a><pre>func SelectionString(s *<a href="#Selection">Selection</a>, qf <a href="#Qualifier">Qualifier</a>) <a href="/builtin#string">string</a></pre></div><p>
SelectionString returns the string form of s.
The Qualifier controls the printing of
package-level objects, and may be nil.
</p>
<p>
Examples:
</p>
<pre>"field (T) f int"
"method (T) f(X) Y"
"method expr (T) f(X) Y"
</pre>
<h3 id="TypeString" data-kind="f">func <a title="View Source" href="https://github.com/golang/go/blob/master/src/go/types/typestring.go#L64">TypeString</a> <a class="permalink" href="#TypeString">¶</a> <a class="uses" title="List Function Callers" href="https://sourcegraph.com/-/godoc/refs?def=TypeString&pkg=go%2Ftypes&repo=">Uses</a></h3>
<div class="funcdecl decl"><a title="View Source" href="https://github.com/golang/go/blob/master/src/go/types/typestring.go#L64">❖</a><pre>func TypeString(typ <a href="#Type">Type</a>, qf <a href="#Qualifier">Qualifier</a>) <a href="/builtin#string">string</a></pre></div><p>
TypeString returns the string representation of typ.
The Qualifier controls the printing of
package-level objects, and may be nil.
</p>
<h3 id="WriteExpr" data-kind="f">func <a title="View Source" href="https://github.com/golang/go/blob/master/src/go/types/exprstring.go#L22">WriteExpr</a> <a class="permalink" href="#WriteExpr">¶</a> <a class="uses" title="List Function Callers" href="https://sourcegraph.com/-/godoc/refs?def=WriteExpr&pkg=go%2Ftypes&repo=">Uses</a></h3>
<div class="funcdecl decl"><a title="View Source" href="https://github.com/golang/go/blob/master/src/go/types/exprstring.go#L22">❖</a><pre>func WriteExpr(buf *<a href="/bytes">bytes</a>.<a href="/bytes#Buffer">Buffer</a>, x <a href="/go/ast">ast</a>.<a href="/go/ast#Expr">Expr</a>)</pre></div><p>
WriteExpr writes the (possibly simplified) string representation for x to buf.
</p>
<h3 id="WriteSignature" data-kind="f">func <a title="View Source" href="https://github.com/golang/go/blob/master/src/go/types/typestring.go#L274">WriteSignature</a> <a class="permalink" href="#WriteSignature">¶</a> <a class="uses" title="List Function Callers" href="https://sourcegraph.com/-/godoc/refs?def=WriteSignature&pkg=go%2Ftypes&repo=">Uses</a></h3>
<div class="funcdecl decl"><a title="View Source" href="https://github.com/golang/go/blob/master/src/go/types/typestring.go#L274">❖</a><pre>func WriteSignature(buf *<a href="/bytes">bytes</a>.<a href="/bytes#Buffer">Buffer</a>, sig *<a href="#Signature">Signature</a>, qf <a href="#Qualifier">Qualifier</a>)</pre></div><p>
WriteSignature writes the representation of the signature sig to buf,
without a leading "func" keyword.
The Qualifier controls the printing of
package-level objects, and may be nil.
</p>
<h3 id="WriteType" data-kind="f">func <a title="View Source" href="https://github.com/golang/go/blob/master/src/go/types/typestring.go#L73">WriteType</a> <a class="permalink" href="#WriteType">¶</a> <a class="uses" title="List Function Callers" href="https://sourcegraph.com/-/godoc/refs?def=WriteType&pkg=go%2Ftypes&repo=">Uses</a></h3>
<div class="funcdecl decl"><a title="View Source" href="https://github.com/golang/go/blob/master/src/go/types/typestring.go#L73">❖</a><pre>func WriteType(buf *<a href="/bytes">bytes</a>.<a href="/bytes#Buffer">Buffer</a>, typ <a href="#Type">Type</a>, qf <a href="#Qualifier">Qualifier</a>)</pre></div><p>
WriteType writes the string representation of typ to buf.
The Qualifier controls the printing of
package-level objects, and may be nil.
</p>
<h3 id="Array" data-kind="t">type <a title="View Source" href="https://github.com/golang/go/blob/master/src/go/types/type.go#L94">Array</a> <a class="permalink" href="#Array">¶</a> <a class="uses" title="List Uses of This Type" href="https://sourcegraph.com/-/godoc/refs?def=Array&pkg=go%2Ftypes&repo=">Uses</a></h3>
<div class="decl" data-kind="d"><a title="View Source" href="https://github.com/golang/go/blob/master/src/go/types/type.go#L94">❖</a><pre>type Array struct {
<span class="com">// contains filtered or unexported fields</span>
}</pre></div><p>
An Array represents an array type.
</p>
<h4 id="NewArray" data-kind="f">func <a title="View Source" href="https://github.com/golang/go/blob/master/src/go/types/type.go#L100">NewArray</a> <a class="permalink" href="#NewArray">¶</a> <a class="uses" title="List Function Callers" href="https://sourcegraph.com/-/godoc/refs?def=NewArray&pkg=go%2Ftypes&repo=">Uses</a></h4>
<div class="funcdecl decl"><a title="View Source" href="https://github.com/golang/go/blob/master/src/go/types/type.go#L100">❖</a><pre>func NewArray(elem <a href="#Type">Type</a>, len <a href="/builtin#int64">int64</a>) *<a href="#Array">Array</a></pre></div><p>
NewArray returns a new array type for the given element type and length.
</p>
<h4 id="Array.Elem" data-kind="m">func (*Array) <a title="View Source" href="https://github.com/golang/go/blob/master/src/go/types/type.go#L106">Elem</a> <a class="permalink" href="#Array.Elem">¶</a> <a class="uses" title="List Method Callers" href="https://sourcegraph.com/-/godoc/refs?def=Array%2FElem&pkg=go%2Ftypes&repo=">Uses</a></h4>
<div class="funcdecl decl"><a title="View Source" href="https://github.com/golang/go/blob/master/src/go/types/type.go#L106">❖</a><pre>func (a *<a href="#Array">Array</a>) Elem() <a href="#Type">Type</a></pre></div><p>
Elem returns element type of array a.
</p>
<h4 id="Array.Len" data-kind="m">func (*Array) <a title="View Source" href="https://github.com/golang/go/blob/master/src/go/types/type.go#L103">Len</a> <a class="permalink" href="#Array.Len">¶</a> <a class="uses" title="List Method Callers" href="https://sourcegraph.com/-/godoc/refs?def=Array%2FLen&pkg=go%2Ftypes&repo=">Uses</a></h4>
<div class="funcdecl decl"><a title="View Source" href="https://github.com/golang/go/blob/master/src/go/types/type.go#L103">❖</a><pre>func (a *<a href="#Array">Array</a>) Len() <a href="/builtin#int64">int64</a></pre></div><p>
Len returns the length of array a.
</p>
<h4 id="Array.String" data-kind="m">func (*Array) <a title="View Source" href="https://github.com/golang/go/blob/master/src/go/types/type.go#L441">String</a> <a class="permalink" href="#Array.String">¶</a> <a class="uses" title="List Method Callers" href="https://sourcegraph.com/-/godoc/refs?def=Array%2FString&pkg=go%2Ftypes&repo=">Uses</a></h4>
<div class="funcdecl decl"><a title="View Source" href="https://github.com/golang/go/blob/master/src/go/types/type.go#L441">❖</a><pre>func (t *<a href="#Array">Array</a>) String() <a href="/builtin#string">string</a></pre></div>
<h4 id="Array.Underlying" data-kind="m">func (*Array) <a title="View Source" href="https://github.com/golang/go/blob/master/src/go/types/type.go#L429">Underlying</a> <a class="permalink" href="#Array.Underlying">¶</a> <a class="uses" title="List Method Callers" href="https://sourcegraph.com/-/godoc/refs?def=Array%2FUnderlying&pkg=go%2Ftypes&repo=">Uses</a></h4>
<div class="funcdecl decl"><a title="View Source" href="https://github.com/golang/go/blob/master/src/go/types/type.go#L429">❖</a><pre>func (t *<a href="#Array">Array</a>) Underlying() <a href="#Type">Type</a></pre></div>
<h3 id="Basic" data-kind="t">type <a title="View Source" href="https://github.com/golang/go/blob/master/src/go/types/type.go#L78">Basic</a> <a class="permalink" href="#Basic">¶</a> <a class="uses" title="List Uses of This Type" href="https://sourcegraph.com/-/godoc/refs?def=Basic&pkg=go%2Ftypes&repo=">Uses</a></h3>
<div class="decl" data-kind="d"><a title="View Source" href="https://github.com/golang/go/blob/master/src/go/types/type.go#L78">❖</a><pre>type Basic struct {
<span class="com">// contains filtered or unexported fields</span>
}</pre></div><p>
A Basic represents a basic type.
</p>
<h4 id="Basic.Info" data-kind="m">func (*Basic) <a title="View Source" href="https://github.com/golang/go/blob/master/src/go/types/type.go#L88">Info</a> <a class="permalink" href="#Basic.Info">¶</a> <a class="uses" title="List Method Callers" href="https://sourcegraph.com/-/godoc/refs?def=Basic%2FInfo&pkg=go%2Ftypes&repo=">Uses</a></h4>
<div class="funcdecl decl"><a title="View Source" href="https://github.com/golang/go/blob/master/src/go/types/type.go#L88">❖</a><pre>func (b *<a href="#Basic">Basic</a>) Info() <a href="#BasicInfo">BasicInfo</a></pre></div><p>
Info returns information about properties of basic type b.
</p>
<h4 id="Basic.Kind" data-kind="m">func (*Basic) <a title="View Source" href="https://github.com/golang/go/blob/master/src/go/types/type.go#L85">Kind</a> <a class="permalink" href="#Basic.Kind">¶</a> <a class="uses" title="List Method Callers" href="https://sourcegraph.com/-/godoc/refs?def=Basic%2FKind&pkg=go%2Ftypes&repo=">Uses</a></h4>
<div class="funcdecl decl"><a title="View Source" href="https://github.com/golang/go/blob/master/src/go/types/type.go#L85">❖</a><pre>func (b *<a href="#Basic">Basic</a>) Kind() <a href="#BasicKind">BasicKind</a></pre></div><p>
Kind returns the kind of basic type b.
</p>
<h4 id="Basic.Name" data-kind="m">func (*Basic) <a title="View Source" href="https://github.com/golang/go/blob/master/src/go/types/type.go#L91">Name</a> <a class="permalink" href="#Basic.Name">¶</a> <a class="uses" title="List Method Callers" href="https://sourcegraph.com/-/godoc/refs?def=Basic%2FName&pkg=go%2Ftypes&repo=">Uses</a></h4>
<div class="funcdecl decl"><a title="View Source" href="https://github.com/golang/go/blob/master/src/go/types/type.go#L91">❖</a><pre>func (b *<a href="#Basic">Basic</a>) Name() <a href="/builtin#string">string</a></pre></div><p>
Name returns the name of basic type b.
</p>
<h4 id="Basic.String" data-kind="m">func (*Basic) <a title="View Source" href="https://github.com/golang/go/blob/master/src/go/types/type.go#L440">String</a> <a class="permalink" href="#Basic.String">¶</a> <a class="uses" title="List Method Callers" href="https://sourcegraph.com/-/godoc/refs?def=Basic%2FString&pkg=go%2Ftypes&repo=">Uses</a></h4>
<div class="funcdecl decl"><a title="View Source" href="https://github.com/golang/go/blob/master/src/go/types/type.go#L440">❖</a><pre>func (t *<a href="#Basic">Basic</a>) String() <a href="/builtin#string">string</a></pre></div>
<h4 id="Basic.Underlying" data-kind="m">func (*Basic) <a title="View Source" href="https://github.com/golang/go/blob/master/src/go/types/type.go#L428">Underlying</a> <a class="permalink" href="#Basic.Underlying">¶</a> <a class="uses" title="List Method Callers" href="https://sourcegraph.com/-/godoc/refs?def=Basic%2FUnderlying&pkg=go%2Ftypes&repo=">Uses</a></h4>
<div class="funcdecl decl"><a title="View Source" href="https://github.com/golang/go/blob/master/src/go/types/type.go#L428">❖</a><pre>func (t *<a href="#Basic">Basic</a>) Underlying() <a href="#Type">Type</a></pre></div>
<h3 id="BasicInfo" data-kind="t">type <a title="View Source" href="https://github.com/golang/go/blob/master/src/go/types/type.go#L60">BasicInfo</a> <a class="permalink" href="#BasicInfo">¶</a> <a class="uses" title="List Uses of This Type" href="https://sourcegraph.com/-/godoc/refs?def=BasicInfo&pkg=go%2Ftypes&repo=">Uses</a></h3>
<div class="decl" data-kind="d"><a title="View Source" href="https://github.com/golang/go/blob/master/src/go/types/type.go#L60">❖</a><pre>type BasicInfo <a href="/builtin#int">int</a></pre></div><p>
BasicInfo is a set of flags describing properties of a basic type.
</p>
<div class="decl" data-kind="c"><a title="View Source" href="https://github.com/golang/go/blob/master/src/go/types/type.go#L63">❖</a><pre>const (
<span id="IsBoolean">IsBoolean</span> <a href="#BasicInfo">BasicInfo</a> = 1 << <a href="/builtin#iota">iota</a>
<span id="IsInteger">IsInteger</span>
<span id="IsUnsigned">IsUnsigned</span>
<span id="IsFloat">IsFloat</span>
<span id="IsComplex">IsComplex</span>
<span id="IsString">IsString</span>
<span id="IsUntyped">IsUntyped</span>
<span id="IsOrdered">IsOrdered</span> = <a href="#IsInteger">IsInteger</a> | <a href="#IsFloat">IsFloat</a> | <a href="#IsString">IsString</a>
<span id="IsNumeric">IsNumeric</span> = <a href="#IsInteger">IsInteger</a> | <a href="#IsFloat">IsFloat</a> | <a href="#IsComplex">IsComplex</a>
<span id="IsConstType">IsConstType</span> = <a href="#IsBoolean">IsBoolean</a> | <a href="#IsNumeric">IsNumeric</a> | <a href="#IsString">IsString</a>
)</pre></div><p>
Properties of basic types.
</p>
<h3 id="BasicKind" data-kind="t">type <a title="View Source" href="https://github.com/golang/go/blob/master/src/go/types/type.go#L20">BasicKind</a> <a class="permalink" href="#BasicKind">¶</a> <a class="uses" title="List Uses of This Type" href="https://sourcegraph.com/-/godoc/refs?def=BasicKind&pkg=go%2Ftypes&repo=">Uses</a></h3>
<div class="decl" data-kind="d"><a title="View Source" href="https://github.com/golang/go/blob/master/src/go/types/type.go#L20">❖</a><pre>type BasicKind <a href="/builtin#int">int</a></pre></div><p>
BasicKind describes the kind of basic type.
</p>
<div class="decl" data-kind="c"><a title="View Source" href="https://github.com/golang/go/blob/master/src/go/types/type.go#L22">❖</a><pre>const (
<span id="Invalid">Invalid</span> <a href="#BasicKind">BasicKind</a> = <a href="/builtin#iota">iota</a> <span class="com">// type is invalid
// predeclared types</span>
<span id="Bool">Bool</span>
<span id="Int">Int</span>
<span id="Int8">Int8</span>
<span id="Int16">Int16</span>
<span id="Int32">Int32</span>
<span id="Int64">Int64</span>
<span id="Uint">Uint</span>
<span id="Uint8">Uint8</span>
<span id="Uint16">Uint16</span>
<span id="Uint32">Uint32</span>
<span id="Uint64">Uint64</span>
<span id="Uintptr">Uintptr</span>
<span id="Float32">Float32</span>
<span id="Float64">Float64</span>
<span id="Complex64">Complex64</span>
<span id="Complex128">Complex128</span>
<span id="String">String</span>
<span id="UnsafePointer">UnsafePointer</span>
<span class="com">// types for untyped values</span>
<span id="UntypedBool">UntypedBool</span>
<span id="UntypedInt">UntypedInt</span>
<span id="UntypedRune">UntypedRune</span>
<span id="UntypedFloat">UntypedFloat</span>
<span id="UntypedComplex">UntypedComplex</span>
<span id="UntypedString">UntypedString</span>
<span id="UntypedNil">UntypedNil</span>
<span class="com">// aliases</span>
<span id="Byte">Byte</span> = <a href="#Uint8">Uint8</a>
<span id="Rune">Rune</span> = <a href="#Int32">Int32</a>
)</pre></div>
<h3 id="Builtin" data-kind="t">type <a title="View Source" href="https://github.com/golang/go/blob/master/src/go/types/object.go#L252">Builtin</a> <a class="permalink" href="#Builtin">¶</a> <a class="uses" title="List Uses of This Type" href="https://sourcegraph.com/-/godoc/refs?def=Builtin&pkg=go%2Ftypes&repo=">Uses</a></h3>
<div class="decl" data-kind="d"><a title="View Source" href="https://github.com/golang/go/blob/master/src/go/types/object.go#L252">❖</a><pre>type Builtin struct {
<span class="com">// contains filtered or unexported fields</span>
}</pre></div><p>
A Builtin represents a built-in function.
Builtins don't have a valid type.
</p>
<h4 id="Builtin.Exported" data-kind="m">func (*Builtin) <a title="View Source" href="https://github.com/golang/go/blob/master/src/go/types/object.go#L96">Exported</a> <a class="permalink" href="#Builtin.Exported">¶</a> <a class="uses" title="List Method Callers" href="https://sourcegraph.com/-/godoc/refs?def=object%2FExported&pkg=go%2Ftypes&repo=">Uses</a></h4>
<div class="funcdecl decl"><a title="View Source" href="https://github.com/golang/go/blob/master/src/go/types/object.go#L96">❖</a><pre>func (obj *Builtin) Exported() <a href="/builtin#bool">bool</a></pre></div>
<h4 id="Builtin.Id" data-kind="m">func (*Builtin) <a title="View Source" href="https://github.com/golang/go/blob/master/src/go/types/object.go#L97">Id</a> <a class="permalink" href="#Builtin.Id">¶</a> <a class="uses" title="List Method Callers" href="https://sourcegraph.com/-/godoc/refs?def=object%2FId&pkg=go%2Ftypes&repo=">Uses</a></h4>
<div class="funcdecl decl"><a title="View Source" href="https://github.com/golang/go/blob/master/src/go/types/object.go#L97">❖</a><pre>func (obj *Builtin) Id() <a href="/builtin#string">string</a></pre></div>
<h4 id="Builtin.Name" data-kind="m">func (*Builtin) <a title="View Source" href="https://github.com/golang/go/blob/master/src/go/types/object.go#L94">Name</a> <a class="permalink" href="#Builtin.Name">¶</a> <a class="uses" title="List Method Callers" href="https://sourcegraph.com/-/godoc/refs?def=object%2FName&pkg=go%2Ftypes&repo=">Uses</a></h4>
<div class="funcdecl decl"><a title="View Source" href="https://github.com/golang/go/blob/master/src/go/types/object.go#L94">❖</a><pre>func (obj *Builtin) Name() <a href="/builtin#string">string</a></pre></div>
<h4 id="Builtin.Parent" data-kind="m">func (*Builtin) <a title="View Source" href="https://github.com/golang/go/blob/master/src/go/types/object.go#L91">Parent</a> <a class="permalink" href="#Builtin.Parent">¶</a> <a class="uses" title="List Method Callers" href="https://sourcegraph.com/-/godoc/refs?def=object%2FParent&pkg=go%2Ftypes&repo=">Uses</a></h4>
<div class="funcdecl decl"><a title="View Source" href="https://github.com/golang/go/blob/master/src/go/types/object.go#L91">❖</a><pre>func (obj *Builtin) Parent() *<a href="#Scope">Scope</a></pre></div>
<h4 id="Builtin.Pkg" data-kind="m">func (*Builtin) <a title="View Source" href="https://github.com/golang/go/blob/master/src/go/types/object.go#L93">Pkg</a> <a class="permalink" href="#Builtin.Pkg">¶</a> <a class="uses" title="List Method Callers" href="https://sourcegraph.com/-/godoc/refs?def=object%2FPkg&pkg=go%2Ftypes&repo=">Uses</a></h4>
<div class="funcdecl decl"><a title="View Source" href="https://github.com/golang/go/blob/master/src/go/types/object.go#L93">❖</a><pre>func (obj *Builtin) Pkg() *<a href="#Package">Package</a></pre></div>
<h4 id="Builtin.Pos" data-kind="m">func (*Builtin) <a title="View Source" href="https://github.com/golang/go/blob/master/src/go/types/object.go#L92">Pos</a> <a class="permalink" href="#Builtin.Pos">¶</a> <a class="uses" title="List Method Callers" href="https://sourcegraph.com/-/godoc/refs?def=object%2FPos&pkg=go%2Ftypes&repo=">Uses</a></h4>
<div class="funcdecl decl"><a title="View Source" href="https://github.com/golang/go/blob/master/src/go/types/object.go#L92">❖</a><pre>func (obj *Builtin) Pos() <a href="/go/token">token</a>.<a href="/go/token#Pos">Pos</a></pre></div>
<h4 id="Builtin.String" data-kind="m">func (*Builtin) <a title="View Source" href="https://github.com/golang/go/blob/master/src/go/types/object.go#L363">String</a> <a class="permalink" href="#Builtin.String">¶</a> <a class="uses" title="List Method Callers" href="https://sourcegraph.com/-/godoc/refs?def=Builtin%2FString&pkg=go%2Ftypes&repo=">Uses</a></h4>
<div class="funcdecl decl"><a title="View Source" href="https://github.com/golang/go/blob/master/src/go/types/object.go#L363">❖</a><pre>func (obj *<a href="#Builtin">Builtin</a>) String() <a href="/builtin#string">string</a></pre></div>
<h4 id="Builtin.Type" data-kind="m">func (*Builtin) <a title="View Source" href="https://github.com/golang/go/blob/master/src/go/types/object.go#L95">Type</a> <a class="permalink" href="#Builtin.Type">¶</a> <a class="uses" title="List Method Callers" href="https://sourcegraph.com/-/godoc/refs?def=object%2FType&pkg=go%2Ftypes&repo=">Uses</a></h4>
<div class="funcdecl decl"><a title="View Source" href="https://github.com/golang/go/blob/master/src/go/types/object.go#L95">❖</a><pre>func (obj *Builtin) Type() <a href="#Type">Type</a></pre></div>
<h3 id="Chan" data-kind="t">type <a title="View Source" href="https://github.com/golang/go/blob/master/src/go/types/type.go#L351">Chan</a> <a class="permalink" href="#Chan">¶</a> <a class="uses" title="List Uses of This Type" href="https://sourcegraph.com/-/godoc/refs?def=Chan&pkg=go%2Ftypes&repo=">Uses</a></h3>
<div class="decl" data-kind="d"><a title="View Source" href="https://github.com/golang/go/blob/master/src/go/types/type.go#L351">❖</a><pre>type Chan struct {
<span class="com">// contains filtered or unexported fields</span>
}</pre></div><p>
A Chan represents a channel type.
</p>
<h4 id="NewChan" data-kind="f">func <a title="View Source" href="https://github.com/golang/go/blob/master/src/go/types/type.go#L367">NewChan</a> <a class="permalink" href="#NewChan">¶</a> <a class="uses" title="List Function Callers" href="https://sourcegraph.com/-/godoc/refs?def=NewChan&pkg=go%2Ftypes&repo=">Uses</a></h4>
<div class="funcdecl decl"><a title="View Source" href="https://github.com/golang/go/blob/master/src/go/types/type.go#L367">❖</a><pre>func NewChan(dir <a href="#ChanDir">ChanDir</a>, elem <a href="#Type">Type</a>) *<a href="#Chan">Chan</a></pre></div><p>
NewChan returns a new channel type for the given direction and element type.
</p>
<h4 id="Chan.Dir" data-kind="m">func (*Chan) <a title="View Source" href="https://github.com/golang/go/blob/master/src/go/types/type.go#L372">Dir</a> <a class="permalink" href="#Chan.Dir">¶</a> <a class="uses" title="List Method Callers" href="https://sourcegraph.com/-/godoc/refs?def=Chan%2FDir&pkg=go%2Ftypes&repo=">Uses</a></h4>
<div class="funcdecl decl"><a title="View Source" href="https://github.com/golang/go/blob/master/src/go/types/type.go#L372">❖</a><pre>func (c *<a href="#Chan">Chan</a>) Dir() <a href="#ChanDir">ChanDir</a></pre></div><p>
Dir returns the direction of channel c.
</p>
<h4 id="Chan.Elem" data-kind="m">func (*Chan) <a title="View Source" href="https://github.com/golang/go/blob/master/src/go/types/type.go#L375">Elem</a> <a class="permalink" href="#Chan.Elem">¶</a> <a class="uses" title="List Method Callers" href="https://sourcegraph.com/-/godoc/refs?def=Chan%2FElem&pkg=go%2Ftypes&repo=">Uses</a></h4>
<div class="funcdecl decl"><a title="View Source" href="https://github.com/golang/go/blob/master/src/go/types/type.go#L375">❖</a><pre>func (c *<a href="#Chan">Chan</a>) Elem() <a href="#Type">Type</a></pre></div><p>
Elem returns the element type of channel c.
</p>
<h4 id="Chan.String" data-kind="m">func (*Chan) <a title="View Source" href="https://github.com/golang/go/blob/master/src/go/types/type.go#L449">String</a> <a class="permalink" href="#Chan.String">¶</a> <a class="uses" title="List Method Callers" href="https://sourcegraph.com/-/godoc/refs?def=Chan%2FString&pkg=go%2Ftypes&repo=">Uses</a></h4>
<div class="funcdecl decl"><a title="View Source" href="https://github.com/golang/go/blob/master/src/go/types/type.go#L449">❖</a><pre>func (t *<a href="#Chan">Chan</a>) String() <a href="/builtin#string">string</a></pre></div>
<h4 id="Chan.Underlying" data-kind="m">func (*Chan) <a title="View Source" href="https://github.com/golang/go/blob/master/src/go/types/type.go#L437">Underlying</a> <a class="permalink" href="#Chan.Underlying">¶</a> <a class="uses" title="List Method Callers" href="https://sourcegraph.com/-/godoc/refs?def=Chan%2FUnderlying&pkg=go%2Ftypes&repo=">Uses</a></h4>
<div class="funcdecl decl"><a title="View Source" href="https://github.com/golang/go/blob/master/src/go/types/type.go#L437">❖</a><pre>func (t *<a href="#Chan">Chan</a>) Underlying() <a href="#Type">Type</a></pre></div>
<h3 id="ChanDir" data-kind="t">type <a title="View Source" href="https://github.com/golang/go/blob/master/src/go/types/type.go#L357">ChanDir</a> <a class="permalink" href="#ChanDir">¶</a> <a class="uses" title="List Uses of This Type" href="https://sourcegraph.com/-/godoc/refs?def=ChanDir&pkg=go%2Ftypes&repo=">Uses</a></h3>
<div class="decl" data-kind="d"><a title="View Source" href="https://github.com/golang/go/blob/master/src/go/types/type.go#L357">❖</a><pre>type ChanDir <a href="/builtin#int">int</a></pre></div><p>
A ChanDir value indicates a channel direction.
</p>
<div class="decl" data-kind="c"><a title="View Source" href="https://github.com/golang/go/blob/master/src/go/types/type.go#L360">❖</a><pre>const (
<span id="SendRecv">SendRecv</span> <a href="#ChanDir">ChanDir</a> = <a href="/builtin#iota">iota</a>
<span id="SendOnly">SendOnly</span>
<span id="RecvOnly">RecvOnly</span>
)</pre></div><p>
The direction of a channel is indicated by one of these constants.
</p>
<h3 id="Checker" data-kind="t">type <a title="View Source" href="https://github.com/golang/go/blob/master/src/go/types/check.go#L62">Checker</a> <a class="permalink" href="#Checker">¶</a> <a class="uses" title="List Uses of This Type" href="https://sourcegraph.com/-/godoc/refs?def=Checker&pkg=go%2Ftypes&repo=">Uses</a></h3>
<div class="decl" data-kind="d"><a title="View Source" href="https://github.com/golang/go/blob/master/src/go/types/check.go#L62">❖</a><pre>type Checker struct {
*<a href="#Info">Info</a>
<span class="com">// contains filtered or unexported fields</span>
}</pre></div><p>
A Checker maintains the state of the type checker.
It must be created with NewChecker.
</p>
<h4 id="NewChecker" data-kind="f">func <a title="View Source" href="https://github.com/golang/go/blob/master/src/go/types/check.go#L148">NewChecker</a> <a class="permalink" href="#NewChecker">¶</a> <a class="uses" title="List Function Callers" href="https://sourcegraph.com/-/godoc/refs?def=NewChecker&pkg=go%2Ftypes&repo=">Uses</a></h4>
<div class="funcdecl decl"><a title="View Source" href="https://github.com/golang/go/blob/master/src/go/types/check.go#L148">❖</a><pre>func NewChecker(conf *<a href="#Config">Config</a>, fset *<a href="/go/token">token</a>.<a href="/go/token#FileSet">FileSet</a>, pkg *<a href="#Package">Package</a>, info *<a href="#Info">Info</a>) *<a href="#Checker">Checker</a></pre></div><p>
NewChecker returns a new Checker instance for a given package.
Package files may be added incrementally via checker.Files.
</p>
<h4 id="Checker.Files" data-kind="m">func (*Checker) <a title="View Source" href="https://github.com/golang/go/blob/master/src/go/types/check.go#L218">Files</a> <a class="permalink" href="#Checker.Files">¶</a> <a class="uses" title="List Method Callers" href="https://sourcegraph.com/-/godoc/refs?def=Checker%2FFiles&pkg=go%2Ftypes&repo=">Uses</a></h4>
<div class="funcdecl decl"><a title="View Source" href="https://github.com/golang/go/blob/master/src/go/types/check.go#L218">❖</a><pre>func (check *<a href="#Checker">Checker</a>) Files(files []*<a href="/go/ast">ast</a>.<a href="/go/ast#File">File</a>) <a href="/builtin#error">error</a></pre></div><p>
Files checks the provided files as part of the checker's package.
</p>
<h3 id="Config" data-kind="t">type <a title="View Source" href="https://github.com/golang/go/blob/master/src/go/types/api.go#L92">Config</a> <a class="permalink" href="#Config">¶</a> <a class="uses" title="List Uses of This Type" href="https://sourcegraph.com/-/godoc/refs?def=Config&pkg=go%2Ftypes&repo=">Uses</a></h3>
<div class="decl" data-kind="d"><a title="View Source" href="https://github.com/golang/go/blob/master/src/go/types/api.go#L92">❖</a><pre>type Config struct {
<span class="com">// If IgnoreFuncBodies is set, function bodies are not
// type-checked.</span>
<span id="Config.IgnoreFuncBodies">IgnoreFuncBodies</span> <a href="/builtin#bool">bool</a>
<span class="com">// If FakeImportC is set, `import "C"` (for packages requiring Cgo)
// declares an empty "C" package and errors are omitted for qualified
// identifiers referring to package C (which won't find an object).
// This feature is intended for the standard library cmd/api tool.
//
// Caution: Effects may be unpredictable due to follow-up errors.
// Do not use casually!</span>
<span id="Config.FakeImportC">FakeImportC</span> <a href="/builtin#bool">bool</a>
<span class="com">// If Error != nil, it is called with each error found
// during type checking; err has dynamic type Error.
// Secondary errors (for instance, to enumerate all types
// involved in an invalid recursive type declaration) have
// error strings that start with a '\t' character.
// If Error == nil, type-checking stops with the first
// error found.</span>
<span id="Config.Error">Error</span> func(err <a href="/builtin#error">error</a>)
<span class="com">// An importer is used to import packages referred to from
// import declarations.
// If the installed importer implements ImporterFrom, the type
// checker calls ImportFrom instead of Import.
// The type checker reports an error if an importer is needed
// but none was installed.</span>
<span id="Config.Importer">Importer</span> <a href="#Importer">Importer</a>
<span class="com">// If Sizes != nil, it provides the sizing functions for package unsafe.
// Otherwise &StdSizes{WordSize: 8, MaxAlign: 8} is used instead.</span>
<span id="Config.Sizes">Sizes</span> <a href="#Sizes">Sizes</a>
<span class="com">// If DisableUnusedImportCheck is set, packages are not checked
// for unused imports.</span>
<span id="Config.DisableUnusedImportCheck">DisableUnusedImportCheck</span> <a href="/builtin#bool">bool</a>
}</pre></div><p>
A Config specifies the configuration for type checking.
The zero value for Config is a ready-to-use default configuration.
</p>
<h4 id="Config.Check" data-kind="m">func (*Config) <a title="View Source" href="https://github.com/golang/go/blob/master/src/go/types/api.go#L347">Check</a> <a class="permalink" href="#Config.Check">¶</a> <a class="uses" title="List Method Callers" href="https://sourcegraph.com/-/godoc/refs?def=Config%2FCheck&pkg=go%2Ftypes&repo=">Uses</a></h4>
<div class="funcdecl decl"><a title="View Source" href="https://github.com/golang/go/blob/master/src/go/types/api.go#L347">❖</a><pre>func (conf *<a href="#Config">Config</a>) Check(path <a href="/builtin#string">string</a>, fset *<a href="/go/token">token</a>.<a href="/go/token#FileSet">FileSet</a>, files []*<a href="/go/ast">ast</a>.<a href="/go/ast#File">File</a>, info *<a href="#Info">Info</a>) (*<a href="#Package">Package</a>, <a href="/builtin#error">error</a>)</pre></div><p>
Check type-checks a package and returns the resulting package object and
the first error if any. Additionally, if info != nil, Check populates each
of the non-nil maps in the Info struct.
</p>
<p>
The package is marked as complete if no errors occurred, otherwise it is
incomplete. See Config.Error for controlling behavior in the presence of
errors.
</p>
<p>