~egtann/inv2config

f27c93b9252a8eefb0aba01952b02a46e6458677 — Evan Tann 4 months ago 7f1bf9e
rename module to inv2config, 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/inventory2config
module egt.run/inv2config

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
@@ 8,8 8,6 @@ import (
	"os"
	"sort"
	"strings"

	"egt.run/up"
)

func main() {


@@ 95,14 93,16 @@ func parseSRPConfig(filename string) (*srpConfig, error) {
	return conf, nil
}

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)
	}