github.com/loggregator/cli@v6.33.1-0.20180224010324-82334f081791+incompatible/cf/formatters/string.go (about)

     1  package formatters
     2  
     3  import (
     4  	"fmt"
     5  	"reflect"
     6  )
     7  
     8  func MapStr(args interface{}) []string {
     9  	r := reflect.ValueOf(args)
    10  	rval := make([]string, r.Len())
    11  	for i := 0; i < r.Len(); i++ {
    12  		rval[i] = r.Index(i).Interface().(fmt.Stringer).String()
    13  	}
    14  	return rval
    15  
    16  }