| 1 |
package pkg |
| 2 |
|
| 3 |
import ( |
| 4 |
"bytes" |
| 5 |
) |
| 6 |
|
| 7 |
type AliasByte = byte |
| 8 |
type AliasSlice = []byte |
| 9 |
type AliasSlice2 = []AliasByte |
| 10 |
|
| 11 |
func fn() { |
| 12 |
buf := bytes.NewBufferString("str") |
| 13 |
m := map[string]*bytes.Buffer{"key": buf} |
| 14 |
|
| 15 |
_ = []AliasByte(m["key"].String()) //@ diag(`should use m["key"].Bytes() instead of []AliasByte(m["key"].String())`) |
| 16 |
_ = AliasSlice(m["key"].String()) //@ diag(`should use m["key"].Bytes() instead of AliasSlice(m["key"].String())`) |
| 17 |
_ = AliasSlice2(m["key"].String()) //@ diag(`should use m["key"].Bytes() instead of AliasSlice2(m["key"].String())`) |
| 18 |
} |