github.com/miolini/go@v0.0.0-20160405192216-fca68c8cb408/src/cmd/vet/testdata/incomplete/examples_test.go (about)

     1  // Test of examples.
     2  
     3  package testdata
     4  
     5  func Example() {} // OK because is package-level.
     6  
     7  func Example_suffix() // OK because refers to suffix annotation.
     8  
     9  func Example_BadSuffix() // OK because non-test package was excluded.  No false positives wanted.
    10  
    11  func ExampleBuf() // OK because non-test package was excluded.  No false positives wanted.
    12  
    13  func ExampleBuf_Append() {} // OK because non-test package was excluded.  No false positives wanted.
    14  
    15  func ExampleBuf_Clear() {} // OK because non-test package was excluded.  No false positives wanted.
    16  
    17  func ExampleBuf_suffix() {} // OK because refers to suffix annotation.
    18  
    19  func ExampleBuf_Append_Bad() {} // OK because non-test package was excluded.  No false positives wanted.
    20  
    21  func ExampleBuf_Append_suffix() {} // OK because refers to known method with valid suffix.
    22  
    23  func ExampleBuf_Reset() bool { return true } // ERROR "ExampleBuf_Reset should return nothing"
    24  
    25  func ExampleBuf_Len(i int) {} // ERROR "ExampleBuf_Len should be niladic"
    26  
    27  // "Puffer" is German for "Buffer".
    28  
    29  func ExamplePuffer() // OK because non-test package was excluded.  No false positives wanted.
    30  
    31  func ExamplePuffer_Append() // OK because non-test package was excluded.  No false positives wanted.
    32  
    33  func ExamplePuffer_suffix() // OK because non-test package was excluded.  No false positives wanted.