mirror of
https://github.com/golang/sys.git
synced 2026-02-07 19:26:03 +03:00
Change-Id: I71b9023fcb6c9860ea35ba0d2cf77a6eed5176b9 Reviewed-on: https://go-review.googlesource.com/c/sys/+/357329 Reviewed-by: Jason A. Donenfeld <Jason@zx2c4.com> Reviewed-by: David Crawshaw <crawshaw@golang.org> Trust: Jason A. Donenfeld <Jason@zx2c4.com> Trust: David Crawshaw <crawshaw@golang.org> Run-TryBot: Jason A. Donenfeld <Jason@zx2c4.com> TryBot-Result: Go Bot <gobot@golang.org>
24 lines
522 B
Go
24 lines
522 B
Go
// Copyright 2009 The Go Authors. All rights reserved.
|
|
// Use of this source code is governed by a BSD-style
|
|
// license that can be found in the LICENSE file.
|
|
|
|
//go:build windows
|
|
// +build windows
|
|
|
|
package windows
|
|
|
|
func itoa(val int) string { // do it here rather than with fmt to avoid dependency
|
|
if val < 0 {
|
|
return "-" + itoa(-val)
|
|
}
|
|
var buf [32]byte // big enough for int64
|
|
i := len(buf) - 1
|
|
for val >= 10 {
|
|
buf[i] = byte(val%10 + '0')
|
|
i--
|
|
val /= 10
|
|
}
|
|
buf[i] = byte(val + '0')
|
|
return string(buf[i:])
|
|
}
|