Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tclegg@veritasgenetics.com>
cfg.debugLogf = func(string, ...interface{}) {}
}
cfg.debugLogf = func(string, ...interface{}) {}
}
- if f := formatter[strings.ToLower(cfg.LogFormat)]; f == nil {
+ f := formatter[strings.ToLower(cfg.LogFormat)]
+ if f == nil {
return fmt.Errorf(`unsupported log format %q (try "text" or "json")`, cfg.LogFormat)
return fmt.Errorf(`unsupported log format %q (try "text" or "json")`, cfg.LogFormat)
- } else {
- log.Formatter = f
if cfg.MaxBuffers < 0 {
return fmt.Errorf("MaxBuffers must be greater than zero")
if cfg.MaxBuffers < 0 {
return fmt.Errorf("MaxBuffers must be greater than zero")
-// UnmarshalJSON, given an array of objects, deserializes each object
-// as the volume type indicated by the object's Type field.
-func (vols *VolumeList) UnmarshalJSON(data []byte) error {
+// UnmarshalJSON -- given an array of objects -- deserializes each
+// object as the volume type indicated by the object's Type field.
+func (vl *VolumeList) UnmarshalJSON(data []byte) error {
typeMap := map[string]func() VolumeWithExamples{}
for _, factory := range VolumeTypes {
t := factory().Type()
typeMap := map[string]func() VolumeWithExamples{}
for _, factory := range VolumeTypes {
t := factory().Type()
if err != nil {
return err
}
if err != nil {
return err
}
- *vols = append(*vols, vol)