It is illegal to take the address of such an element; if s[i] is the i'th byte of a string, &s[i] is invalid.

The Go Programming Language Specification - The Go Programming Language https://golang.google.cn/ref/spec#Numeric_types

 

posted @ 2022-03-22 10:46  papering  阅读(35)  评论(0编辑  收藏  举报