github.com/ldez/golangci-lint@v1.10.1/pkg/result/processors/testdata/nolint.go (about)

     1  package testdata
     2  
     3  var nolintSpecific int    // nolint:gofmt
     4  var nolintSpace int       // nolint: gofmt
     5  var nolintSpaces int      //nolint: gofmt, govet
     6  var nolintAll int         // nolint
     7  var nolintAndAppendix int // nolint // another comment
     8  
     9  //nolint
    10  var nolintVarByPrecedingComment int
    11  
    12  //nolint
    13  
    14  var dontNolintVarByPrecedingCommentBecauseOfNewLine int
    15  
    16  var nolintPrecedingVar string //nolint
    17  var dontNolintVarByPrecedingCommentBecauseOfDifferentColumn int
    18  
    19  //nolint
    20  func nolintFuncByPrecedingComment() *string {
    21  	xv := "v"
    22  	return &xv
    23  }
    24  
    25  //nolint
    26  // second line
    27  func nolintFuncByPrecedingMultilineComment1() *string {
    28  	xv := "v"
    29  	return &xv
    30  }
    31  
    32  // first line
    33  //nolint
    34  func nolintFuncByPrecedingMultilineComment2() *string {
    35  	xv := "v"
    36  	return &xv
    37  }
    38  
    39  // first line
    40  //nolint
    41  // third line
    42  func nolintFuncByPrecedingMultilineComment3() *string {
    43  	xv := "v"
    44  	return &xv
    45  }