1// Test that exported names have correct comments.
2
3// Package pkg does something.
4package pkg
5
6import "time"
7
8type T int // MATCH /exported type T.*should.*comment.*or.*unexport/
9
10func (T) F() {} // MATCH /exported method T\.F.*should.*comment.*or.*unexport/
11
12// this is a nice type.
13// MATCH /comment.*exported type U.*should.*form.*"U ..."/
14type U string
15
16// this is a neat function.
17// MATCH /comment.*exported method U\.G.*should.*form.*"G ..."/
18func (U) G() {}
19
20// A V is a string.
21type V string
22
23// V.H has a pointer receiver
24
25func (*V) H() {} // MATCH /exported method V\.H.*should.*comment.*or.*unexport/
26
27var W = "foo" // MATCH /exported var W.*should.*comment.*or.*unexport/
28
29const X = "bar" // MATCH /exported const X.*should.*comment.*or.*unexport/
30
31var Y, Z int // MATCH /exported var Z.*own declaration/
32
33// Location should be okay, since the other var name is an underscore.
34var Location, _ = time.LoadLocation("Europe/Istanbul") // not Constantinople
35
36// this is improperly documented
37// MATCH /comment.*const.*Thing.*form.*"Thing ..."/
38const Thing = "wonderful"
39