Need a unique gift idea?
A Pastebin account makes a great Christmas gift
SHARE
TWEET

Untitled

a guest Aug 10th, 2018 58 Never
Upgrade to PRO!
ENDING IN00days00hours00mins00secs
 
  1. // Load the JSON config file
  2. func Load(configFile string, outputObj interface{}) *errors.ErrorSt {
  3.     var err error
  4.     // Read the config file
  5.     jsonBytes, err := ioutil.ReadFile(configFile)
  6.     if err != nil {
  7.         fmt.Println(err.Error())
  8.         return errors.File().AddDetails(err.Error())
  9.     }
  10.  
  11.     // Parse the config
  12.     if err := json.Unmarshal(jsonBytes, outputObj); err != nil {
  13.         return errors.JSON().AddDetails("Could not parse" + configFile + ": " + err.Error())
  14.     }
  15.     return nil
  16.  
  17. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top