diff options
| author | Franck Cuny <franck@fcuny.net> | 2024-03-06 06:29:24 -0800 |
|---|---|---|
| committer | Franck Cuny <franck@fcuny.net> | 2024-03-06 06:29:24 -0800 |
| commit | 1e4a5aa09c1c8f43722c9c260f011398799a8e8f (patch) | |
| tree | cd73e0fb8ba53bd21cee6ccf2dcc85639bbbb93f /packages/numap/numap.go | |
| parent | set correct git email in the profiles (diff) | |
| download | infra-1e4a5aa09c1c8f43722c9c260f011398799a8e8f.tar.gz | |
rename `tools` to `packages` to follow convention
The convention is to use `pkgs` or `packages` for overlays and
definition of custom packages. Since I'm already using `pkg` for go,
I prefer to use `packages` for my scripts.
Diffstat (limited to 'packages/numap/numap.go')
| -rw-r--r-- | packages/numap/numap.go | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/packages/numap/numap.go b/packages/numap/numap.go new file mode 100644 index 0000000..c65f1f0 --- /dev/null +++ b/packages/numap/numap.go @@ -0,0 +1,31 @@ +package main + +import ( + "encoding/json" + "fmt" + "os" + + "golang.fcuny.net/numap/internal/hwids" +) + +func main() { + hwdb, err := hwids.Load() + if err != nil { + fmt.Println(err) + os.Exit(1) + } + + nodes, err := findNodes(hwdb) + if err != nil { + fmt.Println(err) + os.Exit(1) + } + + out, err := json.Marshal(nodes) + if err != nil { + fmt.Println(err) + os.Exit(1) + } + + fmt.Println(string(out)) +} |
