mirror of
https://github.com/hashicorp/vault.git
synced 2026-06-09 00:33:28 -04:00
Merge pull request #1309 from hashicorp/issue-1308
Fix panic when using -field with read or write with a non-string value.
This commit is contained in:
commit
1bf6551807
2 changed files with 4 additions and 4 deletions
|
|
@ -70,9 +70,9 @@ func (c *ReadCommand) Run(args []string) int {
|
|||
// directly print the message. If mitchellh/cli exposes method
|
||||
// to print without CR, this check needs to be removed.
|
||||
if reflect.TypeOf(c.Ui).String() == "*cli.BasicUi" {
|
||||
fmt.Fprintf(os.Stdout, val.(string))
|
||||
fmt.Fprintf(os.Stdout, fmt.Sprintf("%v", val))
|
||||
} else {
|
||||
c.Ui.Output(val.(string))
|
||||
c.Ui.Output(fmt.Sprintf("%v", val))
|
||||
}
|
||||
return 0
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -82,9 +82,9 @@ func (c *WriteCommand) Run(args []string) int {
|
|||
// directly print the message. If mitchellh/cli exposes method
|
||||
// to print without CR, this check needs to be removed.
|
||||
if reflect.TypeOf(c.Ui).String() == "*cli.BasicUi" {
|
||||
fmt.Fprintf(os.Stdout, val.(string))
|
||||
fmt.Fprintf(os.Stdout, fmt.Sprintf("%v", val))
|
||||
} else {
|
||||
c.Ui.Output(val.(string))
|
||||
c.Ui.Output(fmt.Sprintf("%v", val))
|
||||
}
|
||||
return 0
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Reference in a new issue