Skip to content

Latest commit

 

History

History
31 lines (22 loc) · 840 Bytes

tests.md

File metadata and controls

31 lines (22 loc) · 840 Bytes

Pattern: Common mistaken usage of tests/documentation

Issue: -

Description

To fully use automated testing of Go packages you should apply naming and signature conventions for Test, Benchmark and Example functions. This rule checks for malformed names, wrong signatures and examples documenting inexistent identifiers.

Example of incorrect code:

func Examplesalutations() {
        fmt.Println("hello, and")
        fmt.Println("goodbye")
}

Example of correct code:

func ExampleSalutations() {
        fmt.Println("hello, and")
        fmt.Println("goodbye")
}

Further Reading