add(readme)
This commit is contained in:
1 parent
9078060e65
commit
a54239f971
9 files changed
+343
-7
No files matched your search
@@ -57,6 +57,26 @@ func checkFlags(c *cli.Context) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func checkPath(pathObject string) (string, bool) {
|
||||
str := strings.Split(pathObject, ".")
|
||||
pathObject = ""
|
||||
if len(str) == 1 || str[0] != "" {
|
||||
fmt.Println("Path must start with '.'")
|
||||
return pathObject, false
|
||||
}
|
||||
for key, value := range str {
|
||||
if key == 0 {
|
||||
continue
|
||||
}
|
||||
if key == 1 {
|
||||
pathObject = fmt.Sprintf("%s", value)
|
||||
continue
|
||||
}
|
||||
pathObject = fmt.Sprintf("%s.%s", pathObject, value)
|
||||
}
|
||||
return pathObject, true
|
||||
}
|
||||
|
||||
func printAnswer(data interface{}) {
|
||||
if answer, err := json.MarshalIndent(data, "", " "); err != nil {
|
||||
fmt.Println(err)
|
||||
|
||||
Reference in new issue
Block a user