github.com/pusher/oauth2_proxy@v3.2.0+incompatible/string_array.go (about)

     1  package main
     2  
     3  import (
     4  	"strings"
     5  )
     6  
     7  // StringArray is a type alias for a slice of strings
     8  type StringArray []string
     9  
    10  // Get returns the slice of strings
    11  func (a *StringArray) Get() interface{} {
    12  	return []string(*a)
    13  }
    14  
    15  // Set appends a string to the StringArray
    16  func (a *StringArray) Set(s string) error {
    17  	*a = append(*a, s)
    18  	return nil
    19  }
    20  
    21  // String joins elements of the StringArray into a single comma separated string
    22  func (a *StringArray) String() string {
    23  	return strings.Join(*a, ",")
    24  }