~egtann/inv2ips

0bc9c4427bbe5ba7509354ba6eb7a39e786de872 — Evan Tann 2 months ago e506b4e
rename module to inv2ips, remove up dependency
3 files changed, 5 insertions(+), 9 deletions(-)

M go.mod
M go.sum
M main.go
M go.mod => go.mod +1 -3
@@ 1,5 1,3 @@
module egt.run/inventory2ips
module egt.run/inv2ips

go 1.14

require egt.run/up v0.0.0-20200407145303-e0094c2d396c

M go.sum => go.sum +0 -2
@@ 1,2 0,0 @@
egt.run/up v0.0.0-20200407145303-e0094c2d396c h1:sb3LjVkk3IUaccOYxbMeYeu8MPuVnKRf6eUEWMNsAhc=
egt.run/up v0.0.0-20200407145303-e0094c2d396c/go.mod h1:IPLQX5z2jQTkQW36TA3X2PvSfYf0AxtkoTa0aytsMw0=

M main.go => main.go +4 -4
@@ 7,8 7,6 @@ import (
	"fmt"
	"os"
	"strings"

	"egt.run/up"
)

func main() {


@@ 59,14 57,16 @@ func (s serviceMap) String() string {
	return strings.Join(out, ", ")
}

func parseInventory(filename string) (up.Inventory, error) {
type inventory map[string][]string

func parseInventory(filename string) (inventory, error) {
	fi, err := os.Open(filename)
	if err != nil {
		return nil, err
	}
	defer func() { _ = fi.Close() }()

	inv := up.Inventory{}
	inv := inventory{}
	if err = json.NewDecoder(fi).Decode(&inv); err != nil {
		return nil, fmt.Errorf("decode: %w", err)
	}