Mercurial > yakumo_izuru > aya
comparison vendor/golang.org/x/sys/windows/str.go @ 66:787b5ee0289d draft
Use vendored modules
Signed-off-by: Izuru Yakumo <yakumo.izuru@chaotic.ninja>
author | yakumo.izuru |
---|---|
date | Sun, 23 Jul 2023 13:18:53 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
65:6d985efa0f7a | 66:787b5ee0289d |
---|---|
1 // Copyright 2009 The Go Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style | |
3 // license that can be found in the LICENSE file. | |
4 | |
5 //go:build windows | |
6 // +build windows | |
7 | |
8 package windows | |
9 | |
10 func itoa(val int) string { // do it here rather than with fmt to avoid dependency | |
11 if val < 0 { | |
12 return "-" + itoa(-val) | |
13 } | |
14 var buf [32]byte // big enough for int64 | |
15 i := len(buf) - 1 | |
16 for val >= 10 { | |
17 buf[i] = byte(val%10 + '0') | |
18 i-- | |
19 val /= 10 | |
20 } | |
21 buf[i] = byte(val + '0') | |
22 return string(buf[i:]) | |
23 } |