8 buf := bytes.NewBufferString("str")
9 _ = buf.String() // want `should use buf\.String\(\) instead of string\(buf\.Bytes\(\)\)`
10 _ = buf.Bytes() // want `should use buf\.Bytes\(\) instead of \[\]byte\(buf\.String\(\)\)`
12 m := map[string]*bytes.Buffer{"key": buf}
13 _ = m["key"].String() // want `should use m\["key"\]\.String\(\) instead of string\(m\["key"\]\.Bytes\(\)\)`
14 _ = m["key"].Bytes() // want `should use m\["key"\]\.Bytes\(\) instead of \[\]byte\(m\["key"\]\.String\(\)\)`
17 _ = m2[string(buf.Bytes())] // no warning, this is more efficient than buf.String()
19 string := func(_ interface{}) interface{} {
22 _ = string(m["key"].Bytes())