all: add internal/itoa package

This replaces five implementations scattered across low level packages.
(And I plan to use it in a sixth soon.)
Three of the five were byte-for-byte identical.

Change-Id: I3bbbeeac63723a487986c912b604e10ad1e042f4
Reviewed-on: https://go-review.googlesource.com/c/go/+/301549
Trust: Josh Bleecher Snyder <josharian@gmail.com>
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Emmanuel Odeke <emmanuel@orijtech.com>
This commit is contained in:
Josh Bleecher Snyder 2021-03-13 16:52:16 -08:00
parent 88b8a16089
commit 061a6903a2
32 changed files with 143 additions and 181 deletions

View file

@ -6,6 +6,7 @@ package net
import (
"errors"
"internal/itoa"
"os"
)
@ -38,8 +39,8 @@ func interfaceTable(ifindex int) ([]Interface, error) {
func readInterface(i int) (*Interface, error) {
ifc := &Interface{
Index: i + 1, // Offset the index by one to suit the contract
Name: netdir + "/ipifc/" + itoa(i), // Name is the full path to the interface path in plan9
Index: i + 1, // Offset the index by one to suit the contract
Name: netdir + "/ipifc/" + itoa.Itoa(i), // Name is the full path to the interface path in plan9
}
ifcstat := ifc.Name + "/status"