Source file test/fixedbugs/issue75278.go

     1  // errorcheck -0 -m=2
     2  
     3  // Copyright 2025 The Go Authors. All rights reserved.
     4  // Use of this source code is governed by a BSD-style
     5  // license that can be found in the LICENSE file.
     6  
     7  package p
     8  
     9  var a, b []int
    10  
    11  func NoIndices() { // ERROR "can inline NoIndices with cost 4 as:.*"
    12  	b = a[:]
    13  }
    14  
    15  func LowIndex() { // ERROR "can inline LowIndex with cost 4 as:.*"
    16  	b = a[0:]
    17  }
    18  
    19  func HighIndex() { // ERROR "can inline HighIndex with cost 4 as:.*"
    20  	b = a[:len(a)]
    21  }
    22  
    23  func BothIndices() { // ERROR "can inline BothIndices with cost 4 as:.*"
    24  	b = a[0:len(a)]
    25  }
    26  

View as plain text