func CleanProtoValue()

in pkg/asset/proto_util.go [24:41]


func CleanProtoValue(v *structpb.Value) {
	if v == nil {
		return
	}
	switch t := v.Kind.(type) {
	case *structpb.Value_NullValue, *structpb.Value_NumberValue, *structpb.Value_StringValue, *structpb.Value_BoolValue:
	case *structpb.Value_StructValue:
		CleanStructValue(t.StructValue)
	case *structpb.Value_ListValue:
		if list := t.ListValue; list != nil {
			for i := range list.Values {
				CleanProtoValue(list.Values[i])
			}
		}
	default: // No other kinds should be allowed (including nil).
		v.Kind = &structpb.Value_NullValue{}
	}
}