golang.org/x/tools/gopls@v0.15.3/internal/analysis/useany/testdata/src/a/a.go (about)

     1  // Copyright 2021 The Go Authors. All rights reserved.
     2  // Use of this source code is governed by a BSD-style
     3  // license that can be found in the LICENSE file.
     4  
     5  // This file contains tests for the useany checker.
     6  
     7  package a
     8  
     9  type Any interface{}
    10  
    11  func _[T interface{}]()                    {} // want "could use \"any\" for this empty interface"
    12  func _[X any, T interface{}]()             {} // want "could use \"any\" for this empty interface"
    13  func _[any interface{}]()                  {} // want "could use \"any\" for this empty interface"
    14  func _[T Any]()                            {} // want "could use \"any\" for this empty interface"
    15  func _[T interface{ int | interface{} }]() {} // want "could use \"any\" for this empty interface"
    16  func _[T interface{ int | Any }]()         {} // want "could use \"any\" for this empty interface"
    17  func _[T any]()                            {}
    18  
    19  type _[T interface{}] int                    // want "could use \"any\" for this empty interface"
    20  type _[X any, T interface{}] int             // want "could use \"any\" for this empty interface"
    21  type _[any interface{}] int                  // want "could use \"any\" for this empty interface"
    22  type _[T Any] int                            // want "could use \"any\" for this empty interface"
    23  type _[T interface{ int | interface{} }] int // want "could use \"any\" for this empty interface"
    24  type _[T interface{ int | Any }] int         // want "could use \"any\" for this empty interface"
    25  type _[T any] int