Allow unsetting of FileContentFlag values.
This commit is contained in:
@@ -0,0 +1 @@
|
|||||||
|
bin
|
||||||
@@ -704,6 +704,11 @@ func (f *FileContentFlag) Decode(ctx *DecodeContext) error { // nolint: golint
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
// This allows unsetting of file content flags.
|
||||||
|
if filename == "" {
|
||||||
|
*f = nil
|
||||||
|
return nil
|
||||||
|
}
|
||||||
filename = ExpandPath(filename)
|
filename = ExpandPath(filename)
|
||||||
data, err := ioutil.ReadFile(filename) // nolint: gosec
|
data, err := ioutil.ReadFile(filename) // nolint: gosec
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
Reference in New Issue
Block a user