| 1 |
// errorcheck -0 -m |
| 2 |
|
| 3 |
// Copyright 2019 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 |
// Test escape analysis for functions with variadic arguments |
| 8 |
|
| 9 |
package foo |
| 10 |
|
| 11 |
func debugf(format string, args ...interface{}) { // ERROR "can inline debugf" "format does not escape" "args does not escape" |
| 12 |
// Dummy implementation for non-debug build. |
| 13 |
// A non-empty implementation would be enabled with a build tag. |
| 14 |
} |
| 15 |
|
| 16 |
func bar() { // ERROR "can inline bar" |
| 17 |
value := 10 |
| 18 |
debugf("value is %d", value) // ERROR "inlining call to debugf" "10 does not escape" "\.\.\. argument does not escape" |
| 19 |
} |