Skip to main content

Go Server SDK Usage

GitHub

User Object

The user object is required for all methods. This is the basis of how segmentation and bucketing decisions are made. The only required field in the user object is UserId. The rest are optional and are used by the system for user segmentation into Variables and Features.

See the UserData class in model_user_data.go for all accepted fields.

user := devcycle.User{
UserId: "example_user_id",
}
caution

Any number types passed into customData, privateCustomData or ClientCustomData must be a 64 bit wide type (int64, float64) to avoid any potential issues with floating point error.

In addition to the properties you set on the devcycle.User yourself, these properties are automatically set by the SDK and are ready for segmentation:

PropertyTypeDescription
platformStringPlatform/OS
platformVersionStringPlatform/OS Version

Get and Use Variable by Key