libgo: update to Go 1.11
[official-gcc.git] / libgo / go / go / doc / testdata / d2.go
blob2f56f4fa4ca3a14b9e67823d68db03591de7ef91
1 // Copyright 2012 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file.
5 // Test cases for sort order of declarations.
7 package d
9 // C1 should be second.
10 const C1 = 1
12 // C0 should be first.
13 const C0 = 0
15 // V1 should be second.
16 var V1 uint
18 // V0 should be first.
19 var V0 uintptr
21 // CAx constants should appear after CBx constants.
22 const (
23 CA2 = iota // before CA1
24 CA1 // before CA0
25 CA0 // at end
28 // VAx variables should appear after VBx variables.
29 var (
30 VA2 int // before VA1
31 VA1 int // before VA0
32 VA0 int // at end
35 // T1 should be second.
36 type T1 struct{}
38 // T0 should be first.
39 type T0 struct{}
41 // F1 should be second.
42 func F1() {}
44 // F0 should be first.
45 func F0() {}