git.iko.soy/typeable/oauth2-proxy
on v5.1.0 help sign in
typeable/oauth2-proxy/string_array.go
24 lines 495 B history raw
1package main
3import (
4 "strings"
5)
7// StringArray is a type alias for a slice of strings
8type StringArray []string
10// Get returns the slice of strings
11func (a *StringArray) Get() interface{} {
12 return []string(*a)
15// Set appends a string to the StringArray
16func (a *StringArray) Set(s string) error {
17 *a = append(*a, s)
18 return nil
21// String joins elements of the StringArray into a single comma separated string
22func (a *StringArray) String() string {
23 return strings.Join(*a, ",")