mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
fmt and reflect updates for recent changes
TBR=r OCL=21580 CL=21583
This commit is contained in:
parent
dc7b2e98d2
commit
ba882f9940
7 changed files with 58 additions and 59 deletions
|
|
@ -27,12 +27,13 @@ type FmtTest struct {
|
|||
}
|
||||
|
||||
// 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 }
|
||||
func Bytes(s string) *[]byte {
|
||||
b := new([]byte, len(s)+1);
|
||||
syscall.StringToBytes(b, s);
|
||||
bp := new(*[]byte);
|
||||
*bp = b[0:len(s)];
|
||||
return bp;
|
||||
}
|
||||
|
||||
const B32 uint32 = 1<<32 - 1
|
||||
const B64 uint64 = 1<<64 - 1
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue