blob: 55fa8d025ecaac39bae0dc497e05a45db132d8ea [file] [log] [blame]
David K. Bainbridgebd6b2882021-08-26 13:31:02 +00001// 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
Akash Reddy Kankanalac0014632025-05-21 17:12:20 +05305//go:build plan9
David K. Bainbridgebd6b2882021-08-26 13:31:02 +00006// +build plan9
7
8package plan9
9
10func 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}