~john-koepi/ubuntu/trusty/golang/default

« back to all changes in this revision

Viewing changes to src/pkg/go/printer/testdata/comments.x

  • Committer: Bazaar Package Importer
  • Author(s): Ondřej Surý
  • Date: 2011-04-20 17:36:48 UTC
  • Revision ID: james.westby@ubuntu.com-20110420173648-ifergoxyrm832trd
Tags: upstream-2011.03.07.1
Import upstream version 2011.03.07.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// This is a package for testing comment placement by go/printer.
 
2
//
 
3
package main
 
4
 
 
5
 
 
6
// The SZ struct; it is empty.
 
7
type SZ struct{}
 
8
 
 
9
// The S0 struct; no field is exported.
 
10
type S0 struct {
 
11
        // contains unexported fields
 
12
}
 
13
 
 
14
// The S1 struct; some fields are not exported.
 
15
type S1 struct {
 
16
        S0
 
17
        A, B, C float   // 3 exported fields
 
18
        D       int     // 2 unexported fields
 
19
        // contains unexported fields
 
20
}
 
21
 
 
22
// The S2 struct; all fields are exported.
 
23
type S2 struct {
 
24
        S1
 
25
        A, B, C float   // 3 exported fields
 
26
}
 
27
 
 
28
// The IZ interface; it is empty.
 
29
type SZ interface{}
 
30
 
 
31
// The I0 interface; no method is exported.
 
32
type I0 interface {
 
33
        // contains unexported methods
 
34
}
 
35
 
 
36
// The I1 interface; some methods are not exported.
 
37
type I1 interface {
 
38
        I0
 
39
        F(x float) float        // exported methods
 
40
        // contains unexported methods
 
41
}
 
42
 
 
43
// The I2 interface; all methods are exported.
 
44
type I2 interface {
 
45
        I0
 
46
        F(x float) float        // exported method
 
47
        G(x float) float        // exported method
 
48
}
 
49
 
 
50
// The S3 struct; all comments except for the last one must appear in the export.
 
51
type S3 struct {
 
52
        // lead comment for F1
 
53
        F1      int     // line comment for F1
 
54
        // lead comment for F2
 
55
        F2      int     // line comment for F2
 
56
        // contains unexported fields
 
57
}