codekingpro/portable-devtools
114k
1// errorcheck2 3// Copyright 2011 The Go Authors. All rights reserved.4// Use of this source code is governed by a BSD-style5// license that can be found in the LICENSE file.6 7// Test that error messages say what the source file says8// (uint8 vs byte, int32 vs. rune).9// Does not compile.10 11package main12 13import (14 "fmt"15 "unicode/utf8"16)17 18func f(byte) {}19func g(uint8) {}20 21func main() {22 var x float6423 f(x) // ERROR "byte"24 g(x) // ERROR "uint8"25 26 // Test across imports.27 28 var ff fmt.Formatter29 var fs fmt.State30 ff.Format(fs, x) // ERROR "rune"31 32 utf8.RuneStart(x) // ERROR "byte"33}34 