Removed GetTakesFile and stick to type assertions

Signed-off-by: Sascha Grunert <mail@saschagrunert.de>
This commit is contained in:
Sascha Grunert
2019-08-25 17:50:18 +02:00
parent a1cf7f44b6
commit 38d0ac6296
5 changed files with 23 additions and 94 deletions

View File

@@ -60,12 +60,6 @@ func (f {{ $flag.Name }}Flag) GetValue() string {
{{ $flag.ValueString }}
}
// GetValue returns the flags value as string representation and an empty
// string if the flag takes no value at all.
func (f {{ $flag.Name }}Flag) GetTakesFile() bool {
{{ if eq $flag.TakesFile true }}return f.TakesFile{{ else }}return false{{ end }}
}
// {{ $flag.Name }} looks up the value of a local {{ $flag.Name }}Flag, returns
// {{ $flag.ContextDefault }} if not found
func (c *Context) {{ $flag.Name }}(name string) {{ if ne .ContextType "" }}{{ $flag.ContextType }}{{ else }}{{ $flag.Type }}{{- end }} {