OLD | NEW |
1 // errchk $G $D/$F.go | 1 // errorcheck |
2 | 2 |
3 // Copyright 2009 The Go Authors. All rights reserved. | 3 // Copyright 2009 The Go Authors. All rights reserved. |
4 // Use of this source code is governed by a BSD-style | 4 // Use of this source code is governed by a BSD-style |
5 // license that can be found in the LICENSE file. | 5 // license that can be found in the LICENSE file. |
6 | 6 |
7 package main | 7 package main |
8 | 8 |
9 const ( | 9 const ( |
10 A int = 1 | 10 A int = 1 |
11 B byte; // ERROR "type without expr|expected .=." | 11 B byte; // ERROR "type without expr|expected .=." |
12 ) | 12 ) |
13 | 13 |
14 const LargeA = 1000000000000000000 | 14 const LargeA = 1000000000000000000 |
15 const LargeB = LargeA * LargeA * LargeA | 15 const LargeB = LargeA * LargeA * LargeA |
16 const LargeC = LargeB * LargeB * LargeB // ERROR "constant multiplication overfl
ow" | 16 const LargeC = LargeB * LargeB * LargeB // ERROR "constant multiplication overfl
ow" |
17 | 17 |
18 const AlsoLargeA = LargeA << 400 << 400 >> 400 >> 400 // ERROR "constant shift o
verflow" | 18 const AlsoLargeA = LargeA << 400 << 400 >> 400 >> 400 // ERROR "constant shift o
verflow" |
OLD | NEW |