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
1 changed files with 5 additions and 0 deletions

View File

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