common.go
func SizeOfSlice(ss interface{}) int {
	l := 0
	switch ss := ss.(type) {
	case []string:
		for _, s := range ss {
			l += 4 + len(s) + Padding(len(s))
		}

	case [][]byte:
		for _, s := range ss {
			l += 4 + len(s) + Padding(len(s))
		}

	default:
		v := reflect.ValueOf(ss)
		for i := 0; i < v.Len(); i++ {
			l += v.Index(i).Interface().(XDRSizer).XDRSize()
		}
	}

	return l
}
func SizeOfSlice(ss interface{}) int {
	l := 0
	switch ss := ss.(type) {
	case []string:
		for _, s := range ss {
			l += 4 + len(s) + Padding(len(s))
		}

	case [][]byte:
		for _, s := range ss {
			l += 4 + len(s) + Padding(len(s))
		}

	default:
		v := reflect.ValueOf(ss)
		for i := 0; i < v.Len(); i++ {
			l += v.Index(i).Interface().(XDRSizer).XDRSize()
		}
	}

	return l
}
// SizeOfSlice returns the XDR encoded size of the given []T. Supported types
// for T are string, []byte and types implementing XDRSizer. SizeOfSlice
// panics if the parameter is not a slice or if T is not one of the supported
// types. This function is used by the generated marshalling code.