Files
opentf/vendor/github.com/maximilien/softlayer-go/common/utility.go
Paul Hinze 12eb536b25 godeps: fixup missing deps
This diff was generated by:

 * `godep restore -v`, correcting any hiccups until it succeeded
 * `rm -rf vendor/ Godep`
 * `godep save -v ./...`
2016-05-04 10:54:22 -05:00

25 lines
322 B
Go

package common
import (
"encoding/json"
)
func ValidateJson(s string) (bool, error) {
var js map[string]interface{}
err := json.Unmarshal([]byte(s), &js)
if err != nil {
return false, err
}
return true, nil
}
func IsHttpErrorCode(errorCode int) bool {
if errorCode >= 400 {
return true
}
return false
}