How to generate the cfg of the following Replace method ? I used this command "GOSSAFUNC=Replace:* go tool compile main.go" but it doesn't work. Thanks.
package main
type byteReplacer [256]byte
func (r *byteReplacer) Replace(s string) string {
var buf []byte // lazily allocated
for i := 0; i < len(s); i++ {
b := s[i]
if r[b] != b {
if buf == nil {
buf = []byte(s)
}
buf[i] = r[b]
}
}
if buf == nil {
return s
}
return string(buf)
}
func main() {
}