Expand ~ for FileContentFlag.

This commit is contained in:
Alec Thomas
2018-11-03 09:51:57 +11:00
parent fddfb973d6
commit 041e879d63
+1 -1
View File
@@ -477,7 +477,7 @@ func JoinEscaped(s []string, sep rune) string {
type FileContentFlag []byte
func (f *FileContentFlag) Decode(ctx *DecodeContext) error { // nolint: golint
filename := ctx.Scan.PopValue("filename")
filename := expandPath(ctx.Scan.PopValue("filename"))
data, err := ioutil.ReadFile(filename) // nolint: gosec
if err != nil {
return fmt.Errorf("failed to open %q: %s", filename, err)