I want to create a function to receive an input string which can be string in json format or just a string. For example, something easy like following function.
how about you use something like this:
if err := json.Unmarshal(input, temp_object); err != nil { fmt.Println("it's normal string!") } else { fmt.Println("it's json!") }