Implement Getter interface for StringArray (#104)

This commit fix the issue #98
This commit is contained in:
Berjou 2019-03-20 14:58:14 +01:00 committed by Joel Speed
parent 8cc5fbf859
commit a656435d00

View File

@ -7,6 +7,11 @@ import (
// StringArray is a type alias for a slice of strings // StringArray is a type alias for a slice of strings
type StringArray []string type StringArray []string
// Get returns the slice of strings
func (a *StringArray) Get() interface{} {
return []string(*a)
}
// Set appends a string to the StringArray // Set appends a string to the StringArray
func (a *StringArray) Set(s string) error { func (a *StringArray) Set(s string) error {
*a = append(*a, s) *a = append(*a, s)