code.cloudfoundry.org/cli@v7.1.0+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  }