| 1 |
package pkg |
| 2 |
|
| 3 |
import "fmt" |
| 4 |
|
| 5 |
type Stringable []byte |
| 6 |
|
| 7 |
func (*Stringable) String() string { return "" } |
| 8 |
|
| 9 |
func fn() { |
| 10 |
type ByteSlice []byte |
| 11 |
var b1 []byte |
| 12 |
var b2 ByteSlice |
| 13 |
var b3 *Stringable |
| 14 |
var b4 Stringable |
| 15 |
|
| 16 |
var s string |
| 17 |
fmt.Print(1, b1, 2, []byte(""), b2, s) //@ diag(`could convert argument to string`), diag(`could convert argument to string`), diag(`could convert argument to string`) |
| 18 |
fmt.Fprint(nil, 1, b1, 2, []byte(""), b2, s) //@ diag(`could convert argument to string`), diag(`could convert argument to string`), diag(`could convert argument to string`) |
| 19 |
fmt.Print() |
| 20 |
fmt.Fprint(nil) |
| 21 |
|
| 22 |
fmt.Println(b3) |
| 23 |
fmt.Println(b4) //@ diag(`could convert argument to string`) |
| 24 |
} |