amplitude / analytics-go

Go Amplitude Analytics SDK
MIT License
12 stars 7 forks source link

fix: AMP-57513-Identify-interface-add-logger #17

Closed Mercy811 closed 2 years ago

Mercy811 commented 2 years ago

Summary

When ClearAll(), I pass nil as value, and the encoding would be

"user_properties":{
    "$unset":{"name":"-"}
}

which in other SDKs it is

"user_properties":{
    "$unset": "_"
}

I did a test with the help of @yuhao900914 and it works. Also we checked the backend code which only searches the key $clearAll.

The reason to do that is because there are two data types of Identify.Properties

If I use map[string]interface{}, I cannot add key:value pair to interface type for other operations, for example:

properties[operation][property] = value

So here I use map[string]map[string]interface{} and pass nil as value when ClearAll()

Checklist