I have a slice of bytes which contains a json object inclosed in curlybrackets with some leading characters of variable lenght. I need to trim away the leading characters until the first curlybracket is encountered. How can i do this? Below is some code just to give an idea of what i want it to look like, the "somefunction()" is the function i'm hoping someone can tell me about.
var b = []byte("I want this removed {here is some json}")
a := somefunction(b, "{")
fmt.Println(string(a)) // desired output: {here is some json}