github.com/wanddynosios/cli/v8@v8.7.9-0.20240221182337-1a92e3a7017f/api/cloudcontroller/decode_json.go (about)

     1  package cloudcontroller
     2  
     3  import (
     4  	"bytes"
     5  	"encoding/json"
     6  )
     7  
     8  // DecodeJSON unmarshals JSON into the given object with the appropriate
     9  // settings.
    10  func DecodeJSON(raw []byte, v interface{}) error {
    11  	decoder := json.NewDecoder(bytes.NewBuffer(raw))
    12  	decoder.UseNumber()
    13  	return decoder.Decode(v)
    14  }