(ctx context.Context, desc string, val *int64, str string, changeCount *int)
| 254 | } |
| 255 | |
| 256 | func applyPolicyNumber64(ctx context.Context, desc string, val *int64, str string, changeCount *int) error { |
| 257 | if str == "" { |
| 258 | // not changed |
| 259 | return nil |
| 260 | } |
| 261 | |
| 262 | if str == inheritPolicyString || str == defaultPolicyString { |
| 263 | *changeCount++ |
| 264 | |
| 265 | log(ctx).Infof(" - resetting %q to a default value inherited from parent.", desc) |
| 266 | |
| 267 | *val = 0 |
| 268 | |
| 269 | return nil |
| 270 | } |
| 271 | |
| 272 | v, err := strconv.ParseInt(str, 10, 64) |
| 273 | if err != nil { |
| 274 | return errors.Wrapf(err, "can't parse the %q %q", desc, str) |
| 275 | } |
| 276 | |
| 277 | *changeCount++ |
| 278 | |
| 279 | log(ctx).Infof(" - setting %q to %v.", desc, v) |
| 280 | *val = v |
| 281 | |
| 282 | return nil |
| 283 | } |
| 284 | |
| 285 | func applyPolicyBoolPtr(ctx context.Context, desc string, val **policy.OptionalBool, str string, changeCount *int) error { |
| 286 | if str == "" { |
no outgoing calls
no test coverage detected
searching dependent graphs…