init: init

This commit is contained in:
2026-03-13 21:56:45 +05:30
commit 3a00b9504d
11 changed files with 245 additions and 0 deletions
+43
View File
@@ -0,0 +1,43 @@
package main
import (
"fmt"
"github.com/huml-lang/go-huml"
"io/ioutil"
"log"
)
import "helpers"
func main() {
// Read the content from file
data, err := ioutil.ReadFile("test.huml")
if err != nil {
log.Fatal(err)
} else {
fmt.Println("[IO] File Found")
}
// Test Huml out
var result map[string]any
if err := huml.Unmarshal([]byte(data), &result); err != nil {
panic(err)
}
// Iterate over Tasks
if tasks, ok := result["tasks"].(map[string]interface{}); ok {
for key, value := range tasks {
switch key {
case "pacman":
pkg.pacman(value)
case "file":
fileio.file(value)
// case "user":
// user(value)
// case "group":
// group(value)
}
}
}
}