mirror of
https://github.com/opentffoundation/opentf.git
synced 2026-03-13 01:00:50 -04:00
This diff was generated by: * `godep restore -v`, correcting any hiccups until it succeeded * `rm -rf vendor/ Godep` * `godep save -v ./...`
25 lines
322 B
Go
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
|
|
}
|