美文网首页我爱编程
golang byte and rune

golang byte and rune

作者: 夜空一起砍猩猩 | 来源:发表于2018-07-25 19:20 被阅读0次

cat $GOROOT/src/builtin/builtin.go

package builtin

type byte byte

byte is an alias for uint8 and is equivalent to uint8 in all ways.It is   // used, by convention, to distinguish byte values from 8-bit unsigned   // integer values.   

Really: type byte = uint8 (see golang.org/issue/21601)      

type rune rune

rune is an alias for int32 and is equivalent to int32 in all ways.

It is  used, by convention, to distinguish character values from integer values.

Really: type rune = int32 (see golang.org/issue/21601)  

相关文章

网友评论

    本文标题:golang byte and rune

    本文链接:https://www.haomeiwen.com/subject/axccpftx.html