19177: Adds config to disable sharing links UI on workbenches.
[arvados.git] / sdk / go / arvados / duration.go
index 2696fdb051146ca34bd311e7e29e1092b0a3723e..c922f0a30dd49abd0f11b29f94d2ced6a8ea09cb 100644 (file)
@@ -20,7 +20,9 @@ func (d *Duration) UnmarshalJSON(data []byte) error {
        if data[0] == '"' {
                return d.Set(string(data[1 : len(data)-1]))
        }
-       return fmt.Errorf("duration must be given as a string like \"600s\" or \"1h30m\"")
+       // Mimic error message returned by ParseDuration for a number
+       // without units.
+       return fmt.Errorf("missing unit in duration %q", data)
 }
 
 // MarshalJSON implements json.Marshaler.