1
0
mirror of https://github.com/oauth2-proxy/oauth2-proxy.git synced 2025-01-24 05:26:55 +02:00
oauth2-proxy/string_array.go

25 lines
495 B
Go
Raw Normal View History

2012-12-10 20:59:23 -05:00
package main
import (
2014-11-09 14:51:10 -05:00
"strings"
2012-12-10 20:59:23 -05:00
)
// StringArray is a type alias for a slice of strings
2012-12-10 20:59:23 -05:00
type StringArray []string
// Get returns the slice of strings
func (a *StringArray) Get() interface{} {
return []string(*a)
}
// Set appends a string to the StringArray
2012-12-10 20:59:23 -05:00
func (a *StringArray) Set(s string) error {
*a = append(*a, s)
return nil
}
// String joins elements of the StringArray into a single comma separated string
2012-12-10 20:59:23 -05:00
func (a *StringArray) String() string {
2014-11-09 14:51:10 -05:00
return strings.Join(*a, ",")
2012-12-10 20:59:23 -05:00
}