func mutateValue(v protoreflect.Value) protoreflect.Value {
	switch v := v.Interface().(type) {
	case bool:
		return protoreflect.ValueOfBool(!v)
	case protoreflect.EnumNumber:
		return protoreflect.ValueOfEnum(v + 1)
	case int32:
		return protoreflect.ValueOfInt32(v + 1)
	case int64:
		return protoreflect.ValueOfInt64(v + 1)
	case uint32:
		return protoreflect.ValueOfUint32(v + 1)
	case uint64:
		return protoreflect.ValueOfUint64(v + 1)
	case float32:
		return protoreflect.ValueOfFloat32(v + 1)
	case float64:
		return protoreflect.ValueOfFloat64(v + 1)
	case []byte:
		for i := range v {
			v[i]++
		}
		return protoreflect.ValueOfBytes(v)
	case string:
		return protoreflect.ValueOfString("_" + v)
	case protoreflect.Message:
		v.Range(func(fd protoreflect.FieldDescriptor, val protoreflect.Value) bool {
			v.Set(fd, mutateValue(val))
			return true
		})
		return protoreflect.ValueOfMessage(v)
	case protoreflect.List:
		for i := 0; i < v.Len(); i++ {
			v.Set(i, mutateValue(v.Get(i)))
		}
		return protoreflect.ValueOfList(v)
	case protoreflect.Map:
		v.Range(func(mk protoreflect.MapKey, mv protoreflect.Value) bool {
			v.Set(mk, mutateValue(mv))
			return true
		})
		return protoreflect.ValueOfMap(v)
	default:
		panic(fmt.Sprintf("unknown value type %T", v))
	}
}
// mutateValue changes a Value, returning a new value.
//
// For scalar values, it returns a value different from the input.
// For Message, List, and Map values, it mutates the input and returns it.
mutateValue changes a Value, returning a new value.

For scalar values, it returns a value different from the input.
For Message, List, and Map values, it mutates the input and returns it.
// mutateValue changes a Value returning a new value . // // For scalar values it returns a value different from the input . // For Message List and Map values it mutates the input and returns it .
func mutateValue(v protoreflect.Value) protoreflect.Value {
	switch v := v.Interface().(type) {
	case bool:
		return protoreflect.ValueOfBool(!v)
	case protoreflect.EnumNumber:
		return protoreflect.ValueOfEnum(v + 1)
	case int32:
		return protoreflect.ValueOfInt32(v + 1)
	case int64:
		return protoreflect.ValueOfInt64(v + 1)
	case uint32:
		return protoreflect.ValueOfUint32(v + 1)
	case uint64:
		return protoreflect.ValueOfUint64(v + 1)
	case float32:
		return protoreflect.ValueOfFloat32(v + 1)
	case float64:
		return protoreflect.ValueOfFloat64(v + 1)
	case []byte:
		for i := range v {
			v[i]++
		}
		return protoreflect.ValueOfBytes(v)
	case string:
		return protoreflect.ValueOfString("_" + v)
	case protoreflect.Message:
		v.Range(func(fd protoreflect.FieldDescriptor, val protoreflect.Value) bool {
			v.Set(fd, mutateValue(val))
			return true
		})
		return protoreflect.ValueOfMessage(v)
	case protoreflect.List:
		for i := 0; i < v.Len(); i++ {
			v.Set(i, mutateValue(v.Get(i)))
		}
		return protoreflect.ValueOfList(v)
	case protoreflect.Map:
		v.Range(func(mk protoreflect.MapKey, mv protoreflect.Value) bool {
			v.Set(mk, mutateValue(mv))
			return true
		})
		return protoreflect.ValueOfMap(v)
	default:
		panic(fmt.Sprintf("unknown value type %T", v))
	}
}
func mutateValue ( v protoreflect . Value ) protoreflect . Value { switch v := v . Interface ( ) . ( type ) { case bool : return protoreflect . ValueOfBool ( ! v ) case protoreflect . EnumNumber : return protoreflect . ValueOfEnum ( v + 1 ) case int32 : return protoreflect . ValueOfInt32 ( v + 1 ) case int64 : return protoreflect . ValueOfInt64 ( v + 1 ) case uint32 : return protoreflect . ValueOfUint32 ( v + 1 ) case uint64 : return protoreflect . ValueOfUint64 ( v + 1 ) case float32 : return protoreflect . ValueOfFloat32 ( v + 1 ) case float64 : return protoreflect . ValueOfFloat64 ( v + 1 ) case [ ] byte : for i := range v { v [ i ] ++ } return protoreflect . ValueOfBytes ( v ) case string : return protoreflect . ValueOfString ( " " + v ) case protoreflect . Message : v . Range ( func ( fd protoreflect . FieldDescriptor , val protoreflect . Value ) bool { v . Set ( fd , mutateValue ( val ) ) return true } ) return protoreflect . ValueOfMessage ( v ) case protoreflect . List : for i := 0 ; i < v . Len ( ) ; i ++ { v . Set ( i , mutateValue ( v . Get ( i ) ) ) } return protoreflect . ValueOfList ( v ) case protoreflect . Map : v . Range ( func ( mk protoreflect . MapKey , mv protoreflect . Value ) bool { v . Set ( mk , mutateValue ( mv ) ) return true } ) return protoreflect . ValueOfMap ( v ) default : panic ( fmt . Sprintf ( " " , v ) ) } }
mutateValue changes a Value, returning a new value.
mutateValue changes a Value returning a new value .