mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
convert *[] to [].
R=r OCL=21563 CL=21571
This commit is contained in:
parent
9786f69f74
commit
d47d888ba6
74 changed files with 532 additions and 543 deletions
|
|
@ -26,11 +26,13 @@ type FmtTest struct {
|
|||
out string;
|
||||
}
|
||||
|
||||
func Bytes(s string) *[]byte {
|
||||
b := new([]byte, len(s)+1);
|
||||
syscall.StringToBytes(b, s);
|
||||
return b[0:len(s)];
|
||||
}
|
||||
// TODO(rsc): return []byte, but need to be able to pass as interface.
|
||||
// func Bytes(s string) []byte {
|
||||
// b := new([]byte, len(s)+1);
|
||||
// syscall.StringToBytes(b, s);
|
||||
// return b[0:len(s)];
|
||||
// }
|
||||
func Bytes(s string) string { return s }
|
||||
|
||||
const B32 uint32 = 1<<32 - 1
|
||||
const B64 uint64 = 1<<64 - 1
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue