Home | History | Annotate | Download | only in whitelist
      1 // Non-platform-specific vet whitelist. See readme.txt for details.
      2 
      3 // Issue 17580 (remove when fixed)
      4 cmd/go/go_test.go: +build comment must appear before package clause and be followed by a blank line
      5 
      6 
      7 // Real problems that we can't fix.
      8 
      9 // This is a bad WriteTo signature. Errors are being ignored!
     10 // However, we can't change it due to the Go 1 compatibility promise.
     11 go/types/scope.go: method WriteTo(w io.Writer, n int, recurse bool) should have signature WriteTo(io.Writer) (int64, error)
     12 
     13 
     14 // False positives.
     15 
     16 // Nothing much to do about cross-package assembly. Unfortunate.
     17 runtime/asm_ARCHSUFF.s: [GOARCH] cannot check cross-package assembly function: call is in package reflect
     18 runtime/asm_ARCHSUFF.s: [GOARCH] cannot check cross-package assembly function: Equal is in package bytes
     19 runtime/asm_ARCHSUFF.s: [GOARCH] cannot check cross-package assembly function: IndexByte is in package bytes
     20 runtime/asm_ARCHSUFF.s: [GOARCH] cannot check cross-package assembly function: IndexByte is in package strings
     21 runtime/sys_GOOS_ARCHSUFF.s: [GOARCH] cannot check cross-package assembly function: now is in package time
     22 
     23 // Legitimate vet complaints in which we are testing for correct runtime behavior
     24 // in bad situations that vet can also detect statically.
     25 cmd/cover/testdata/test.go: unreachable code
     26 fmt/fmt_test.go: arg nil for printf verb %s of wrong type: untyped nil
     27 encoding/json/decode_test.go: struct field m has json tag but is not exported
     28 encoding/json/decode_test.go: struct field m2 has json tag but is not exported
     29 encoding/json/tagkey_test.go: struct field tag `:"BadFormat"` not compatible with reflect.StructTag.Get: bad syntax for struct tag key
     30 runtime/testdata/testprog/deadlock.go: unreachable code
     31 runtime/testdata/testprog/deadlock.go: unreachable code
     32 sync/cond_test.go: assignment copies lock value to c2: sync.Cond contains sync.noCopy
     33 
     34 // Non-standard method signatures.
     35 // These cases are basically ok.
     36 // Errors are handled reasonably and there's no clear need for interface satisfaction.
     37 // Except for the runtime/pprof case, the API is not exported.
     38 cmd/internal/bio/buf.go: method Seek(offset int64, whence int) int64 should have signature Seek(int64, int) (int64, error)
     39 cmd/internal/bio/buf.go: method Seek(offset int64, whence int) int64 should have signature Seek(int64, int) (int64, error)
     40 cmd/internal/obj/link.go: method Peek(i int) byte should have signature Peek(int) ([]byte, error)
     41 fmt/print.go: method WriteByte(c byte) should have signature WriteByte(byte) error
     42 runtime/pprof/pprof.go: method WriteTo(w io.Writer, debug int) error should have signature WriteTo(io.Writer) (int64, error)
     43 
     44 // These encoding/xml methods have the correct signature.
     45 // vet doesn't know it because they are *in* the encoding/xml package.
     46 // It's not worth teaching vet about the distinction, so whitelist them.
     47 encoding/gob/encode.go: method WriteByte(c byte) should have signature WriteByte(byte) error
     48 encoding/xml/marshal.go: method MarshalXML(e *Encoder, start StartElement) error should have signature MarshalXML(*xml.Encoder, xml.StartElement) error
     49 encoding/xml/marshal_test.go: method MarshalXML(e *Encoder, start StartElement) error should have signature MarshalXML(*xml.Encoder, xml.StartElement) error
     50 encoding/xml/read.go: method UnmarshalXML(d *Decoder, start StartElement) error should have signature UnmarshalXML(*xml.Decoder, xml.StartElement) error
     51 encoding/xml/read_test.go: method UnmarshalXML(d *Decoder, start StartElement) error should have signature UnmarshalXML(*xml.Decoder, xml.StartElement) error
     52 
     53 // Lots of false positives from the "large shift" check.
     54 // Mostly code that uses clever const tricks to determine
     55 // or use the size of an int or pointer (and related values).
     56 image/png/paeth.go: x might be too small for shift of 63
     57 math/big/arith.go: x might be too small for shift of 32
     58 math/big/arith.go: y might be too small for shift of 32
     59 math/big/arith.go: w0 might be too small for shift of 32
     60 math/big/arith.go: t might be too small for shift of 32
     61 math/big/arith.go: w1 might be too small for shift of 32
     62 math/big/arith.go: v might be too small for shift of 32
     63 math/big/arith.go: un10 might be too small for shift of 32
     64 math/big/arith.go: (xi&yi | (xi|yi)&^zi) might be too small for shift of 63
     65 math/big/arith.go: (yi&^xi | (yi|^xi)&zi) might be too small for shift of 63
     66 math/big/arith.go: xi &^ zi might be too small for shift of 63
     67 math/big/arith.go: (zi &^ xi) might be too small for shift of 63
     68 math/big/float.go: x[i] might be too small for shift of 32
     69 math/big/nat.go: t too small for shift of 64
     70 math/big/nat.go: x too small for shift of 64
     71 math/big/nat.go: ((x & -x) * (deBruijn64 & _M)) might be too small for shift of 58
     72 math/big/nat.go: Word(rand.Uint32()) might be too small for shift of 32
     73 math/big/nat.go: yi might be too small for shift of 60
     74 math/big/nat.go: yi might be too small for shift of 60
     75 runtime/cpuprof.go: h might be too small for shift of 56
     76 runtime/malloc.go: uintptr(i) might be too small for shift of 40
     77 runtime/malloc.go: uintptr(i) might be too small for shift of 40
     78 runtime/malloc.go: uintptr(i) might be too small for shift of 40
     79 sync/atomic/atomic_test.go: uintptr(seed + i) might be too small for shift of 32
     80 sync/atomic/atomic_test.go: uintptr(seed+i) << 32 might be too small for shift of 32
     81 sync/atomic/atomic_test.go: uintptr(seed + i) might be too small for shift of 32
     82 sync/atomic/atomic_test.go: old might be too small for shift of 32
     83 sync/atomic/atomic_test.go: old << 32 might be too small for shift of 32
     84 sync/atomic/atomic_test.go: old might be too small for shift of 32
     85 sync/atomic/atomic_test.go: v might be too small for shift of 32
     86 sync/atomic/atomic_test.go: v might be too small for shift of 32
     87 
     88 // Long struct tags used to test reflect internals
     89 cmd/link/link_test.go: struct field tag "\n\tLondon. Michaelmas term lately over, and the Lord Chancellor sitting in Lincolns Inn Hall. Implacable November weather. As much mud in the streets as if the waters had but newly retired from the face of the earth, and it would not be wonderful to meet a Megalosaurus, forty feet long or so, waddling like an elephantine lizard up Holborn Hill. Smoke lowering down from chimney-pots, making a soft black drizzle, with flakes of soot in it as big as full-grown snowflakesgone into mourning, one might imagine, for the death of the sun. Dogs, undistinguishable in mire. Horses, scarcely better; splashed to their very blinkers. Foot passengers, jostling one anothers umbrellas in a general infection of ill temper, and losing their foot-hold at street-corners, where tens of thousands of other foot passengers have been slipping and sliding since the day broke (if this day ever broke), adding new deposits to the crust upon crust of mud, sticking at those points tenaciously to the pavement, and accumulating at compound interest.\n\n\tFog everywhere. Fog up the river, where it flows among green aits and meadows; fog down the river, where it rolls defiled among the tiers of shipping and the waterside pollutions of a great (and dirty) city. Fog on the Essex marshes, fog on the Kentish heights. Fog creeping into the cabooses of collier-brigs; fog lying out on the yards and hovering in the rigging of great ships; fog drooping on the gunwales of barges and small boats. Fog in the eyes and throats of ancient Greenwich pensioners, wheezing by the firesides of their wards; fog in the stem and bowl of the afternoon pipe of the wrathful skipper, down in his close cabin; fog cruelly pinching the toes and fingers of his shivering little prentice boy on deck. Chance people on the bridges peeping over the parapets into a nether sky of fog, with fog all round them, as if they were up in a balloon and hanging in the misty clouds.\n\n\tGas looming through the fog in divers places in the streets, much as the sun may, from the spongey fields, be seen to loom by husbandman and ploughboy. Most of the shops lighted two hours before their timeas the gas seems to know, for it has a haggard and unwilling look.\n\n\tThe raw afternoon is rawest, and the dense fog is densest, and the muddy streets are muddiest near that leaden-headed old obstruction, appropriate ornament for the threshold of a leaden-headed old corporation, Temple Bar. And hard by Temple Bar, in Lincolns Inn Hall, at the very heart of the fog, sits the Lord High Chancellor in his High Court of Chancery." not compatible with reflect.StructTag.Get: bad syntax for struct tag key
     90 cmd/link/link_test.go: struct field tag "\n\tIt was grand to see how the wind awoke, and bent the trees, and drove the rain before it like a cloud of smoke; and to hear the solemn thunder, and to see the lightning; and while thinking with awe of the tremendous powers by which our little lives are encompassed, to consider how beneficent they are, and how upon the smallest flower and leaf there was already a freshness poured from all this seeming rage, which seemed to make creation new again." not compatible with reflect.StructTag.Get: bad syntax for struct tag key
     91 cmd/link/link_test.go: struct field tag "\n\tJarndyce and Jarndyce drones on. This scarecrow of a suit has, over the course of time, become so complicated, that no man alive knows what it means. The parties to it understand it least; but it has been observed that no two Chancery lawyers can talk about it for five minutes, without coming to a total disagreement as to all the premises. Innumerable children have been born into the cause; innumerable young people have married into it; innumerable old people have died out of it. Scores of persons have deliriously found themselves made parties in Jarndyce and Jarndyce, without knowing how or why; whole families have inherited legendary hatreds with the suit. The little plaintiff or defendant, who was promised a new rocking-horse when Jarndyce and Jarndyce should be settled, has grown up, possessed himself of a real horse, and trotted away into the other world. Fair wards of court have faded into mothers and grandmothers; a long procession of Chancellors has come in and gone out; the legion of bills in the suit have been transformed into mere bills of mortality; there are not three Jarndyces left upon the earth perhaps, since old Tom Jarndyce in despair blew his brains out at a coffee-house in Chancery Lane; but Jarndyce and Jarndyce still drags its dreary length before the Court, perennially hopeless." not compatible with reflect.StructTag.Get: bad syntax for struct tag key
     92 cmd/link/link_test.go: struct field tag "\n\tThe one great principle of the English law is, to make business for itself. There is no other principle distinctly, certainly, and consistently maintained through all its narrow turnings. Viewed by this light it becomes a coherent scheme, and not the monstrous maze the laity are apt to think it. Let them but once clearly perceive that its grand principle is to make business for itself at their expense, and surely they will cease to grumble." not compatible with reflect.StructTag.Get: bad syntax for struct tag key
     93