modernc.org/gc@v1.0.1-0.20240304020402-f0dba7c97c2b/testdata/errchk/test/fixedbugs/issue18331.go (about)

     1  // errorcheck -std
     2  // Copyright 2017 The Go Authors. All rights reserved.
     3  // Use of this source code is governed by a BSD-style
     4  // license that can be found in the LICENSE file.
     5  // Issue 18331: We should catch invalid pragma verbs
     6  // for code that resides in the standard library.
     7  package issue18331
     8  
     9  //go:unknown // ERROR "//go:unknown is not allowed in the standard library"
    10  func foo()
    11  
    12  //go:nowritebarrierc // ERROR "//go:nowritebarrierc is not allowed in the standard library"
    13  func bar()
    14  
    15  //go:noesape // ERROR "//go:noesape is not allowed in the standard library"
    16  func groot()
    17  
    18  //go:noescape
    19  func hey() { // ERROR "can only use //go:noescape with external func implementations"
    20  }