This change introduces a new type rather than modifying FileBytes because the shorter name better represents the flag purpose, and prevents the naming stutter of FileBytes.Bytes, as well, this preserves compatibility with existing users of the flagx.FileBytes type until they can be migrated to this replacement.
This change introduces a new flag type
flagx.File
that preserves the file name during flag handling and should eventually replaceflagx.FileBytes
.In my own experience and two recent PRs (https://github.com/m-lab/measure-saver/pull/7 & https://github.com/m-lab/alertmanager-github-receiver/pull/44 ) it would be more helpful for the file name to be displayed by the flag processing logic, rather than the file contents. The
flagx.FileBytesArray
introduced this idea. This change adds a new flag type that exposes both theFile.Bytes
and theFile.Name
.This change introduces a new type rather than modifying FileBytes because the shorter name better represents the flag purpose, and prevents the naming stutter of
FileBytes.Bytes
, as well, this preserves compatibility with existing users of theflagx.FileBytes
type until they can be migrated to this replacement.This change is