示例#1
0
func dataToString(data interface{}) {
	switch data.(type) {
	case []interface{}:
		for _, elem := range data.([]interface{}) {
			dataToString(elem)
		}
	case map[string]interface{}:
		fmt.Println(util.ToJson(data))
	default:
		fmt.Println(data)
	}
}
示例#2
0
func performPut(args []string) error {
	wasp.SetToken(config.GetAuthToken())
	if len(args) != 2 && !stdIn {
		return errors.New("put takes exactly 2 arguments")
	}
	path := args[0]
	value := ""
	if stdIn {
		value = util.ReadFullyFromStdin()
	} else {
		value = args[1]
	}

	if !rawData {
		value = util.ToJson(value)
	}
	_, err := wasp.Put(path, value)
	return err
}