1

My split.io feature flag is sky_name

feature flag has following treatment { "sk_price":"45788" }

I want to read sk_price when treatment is on.

My sample code is as below

import (
    "github.com/splitio/go-client/v6/splitio/client"
    "github.com/splitio/go-client/v6/splitio/conf"
)

func main() {
    cfg := conf.Default()
    factory, err := client.NewSplitFactory("YOUR_SDK_TYPE_API_KEY", cfg)
    if err != nil {
        
    }

    client := factory.Client()

    err = client.BlockUntilReady(10)
    if err != nil {
       
    }

    treatment := client.Treatment("CUSTOMER_ID", "sky_name", nil)
    if treatment == "on" {

// I want to get the "sk_price" value here when the treatment is on

    } else if treatment == "off" {
        
    } else {
       
    }
}

anothermh
  • 9,815
  • 3
  • 33
  • 52
Madhawa
  • 87
  • 7
  • 1
    [You should not *force* a tag into your title.](https://stackoverflow.com/help/tagging) Because the tags appear below the question and tags are indexed by search engines along with the content of your question, you can trust that other people will be able to find your question based on tags they follow or search for. – anothermh May 11 '23 at 15:29

0 Answers0