mirror of
https://github.com/opbnq-q/nto-cli.git
synced 2025-12-06 17:10:34 +07:00
feat: getting struct fields
This commit is contained in:
23
main.go
Normal file
23
main.go
Normal 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)
|
||||
}
|
||||
Reference in New Issue
Block a user