Add explicit tests for:
#30465 cmd/vet: Consider reverting tag conflict for embedded fields
#30399 cmd/vet: possible to get a printf false positive with big.Int
because we have managed not to fix them in the last
couple point releases, and it will be too embarrassing
to do that yet again.
Change-Id: Ib1da5df870348b6eb9bfc8a87c507ecc6d44b8dd
Reviewed-on: https://go-review.googlesource.com/c/go/+/174520
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
--- /dev/null
+// Copyright 2019 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package print2
+
+import ( // NOTE: Does not import "fmt"
+ "log"
+ "math/big"
+)
+
+var fmt int
+
+func f() {
+ log.Printf("%d", new(big.Int))
+ log.Printf("%d", 1.0) // ERROR "Printf format %d has arg 1.0 of wrong type float64"
+}
package structtag
+import "encoding/json"
+
type StructTagTest struct {
A int "hello" // ERROR "`hello` not compatible with reflect.StructTag.Get: bad syntax for struct tag pair"
}
+
+func Issue30465() {
+ type T1 struct {
+ X string `json:"x"`
+ }
+ type T2 struct {
+ T1
+ X string `json:"x"`
+ }
+ var t2 T2
+ json.Marshal(&t2)
+}
"method",
"nilfunc",
"print",
+ "print2",
"rangeloop",
"shift",
"structtag",