1 // Test of examples with divergent packages.
5 func Example() {} // OK because is package-level.
7 func Example_suffix() {} // OK because refers to suffix annotation.
9 func Example_BadSuffix() {} // want "Example_BadSuffix has malformed example suffix: BadSuffix"
11 func ExampleBuf() {} // OK because refers to known top-level type.
13 func ExampleBuf_Append() {} // OK because refers to known method.
15 func ExampleBuf_Clear() {} // want "ExampleBuf_Clear refers to unknown field or method: Buf.Clear"
17 func ExampleBuf_suffix() {} // OK because refers to suffix annotation.
19 func ExampleBuf_Append_Bad() {} // want "ExampleBuf_Append_Bad has malformed example suffix: Bad"
21 func ExampleBuf_Append_suffix() {} // OK because refers to known method with valid suffix.
23 func ExampleDefaultBuf() {} // OK because refers to top-level identifier.
25 func ExampleBuf_Reset() bool { return true } // want "ExampleBuf_Reset should return nothing"
27 func ExampleBuf_Len(i int) {} // want "ExampleBuf_Len should be niladic"
29 // "Puffer" is German for "Buffer".
31 func ExamplePuffer() {} // want "ExamplePuffer refers to unknown identifier: Puffer"
33 func ExamplePuffer_Append() {} // want "ExamplePuffer_Append refers to unknown identifier: Puffer"
35 func ExamplePuffer_suffix() {} // want "ExamplePuffer_suffix refers to unknown identifier: Puffer"