I'm curious as why Golang doesn't provide a []byte(*string)
method. From a performance perspective, wouldn't []byte(string)
make a copy of the input argument and add more cost (though this seems odd since strings are immutable, why copy them)?
I'm new to Go and would appreciate any clarification.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…