feat: getting struct fields

This commit is contained in:
2025-02-11 18:51:25 +07:00
commit 653c667e57
9 changed files with 139 additions and 0 deletions

23
main.go Normal file
View File

@@ -0,0 +1,23 @@
package main
import (
"fmt"
input "nto_cli/cmd"
"nto_cli/utils"
"os"
)
func main() {
fmt.Print("struct name, path to file (including struct): ")
structName, path := input.Input()
file, err := os.Open(path)
if err != nil {
panic(err)
}
defer file.Close()
structFields := utils.GetStructFields(file, structName)
fmt.Println(structFields)
}