Update vendor for Azure dependencies

Signed-off-by: Stephen Augustus <saugustus@vmware.com>
This commit is contained in:
Stephen Augustus
2019-08-15 18:01:44 -04:00
parent db855f9ba0
commit 14e4b5f8db
183 changed files with 23704 additions and 4938 deletions

View File

@@ -27,7 +27,7 @@ import (
"strings"
"time"
"github.com/satori/go.uuid"
uuid "github.com/satori/go.uuid"
)
// Annotating as secure for gas scanning
@@ -257,6 +257,9 @@ func (e *Entity) MarshalJSON() ([]byte, error) {
case int64:
completeMap[typeKey] = OdataInt64
completeMap[k] = fmt.Sprintf("%v", v)
case float32, float64:
completeMap[typeKey] = OdataDouble
completeMap[k] = fmt.Sprintf("%v", v)
default:
completeMap[k] = v
}
@@ -264,7 +267,8 @@ func (e *Entity) MarshalJSON() ([]byte, error) {
if !(completeMap[k] == OdataBinary ||
completeMap[k] == OdataDateTime ||
completeMap[k] == OdataGUID ||
completeMap[k] == OdataInt64) {
completeMap[k] == OdataInt64 ||
completeMap[k] == OdataDouble) {
return nil, fmt.Errorf("Odata.type annotation %v value is not valid", k)
}
valueKey := strings.TrimSuffix(k, OdataTypeSuffix)
@@ -339,6 +343,12 @@ func (e *Entity) UnmarshalJSON(data []byte) error {
return fmt.Errorf(errorTemplate, err)
}
props[valueKey] = i
case OdataDouble:
f, err := strconv.ParseFloat(str, 64)
if err != nil {
return fmt.Errorf(errorTemplate, err)
}
props[valueKey] = f
default:
return fmt.Errorf(errorTemplate, fmt.Sprintf("%v is not supported", v))
}