// Set a new value on the option. Setting a negative duration value will cause
// an error to be returned.
185321
func (d *PositiveDurationOpt) Set(s string) error {
	err := d.DurationOpt.Set(s)
	if err != nil {
		return err
	}
	if *d.DurationOpt.value < 0 {
		return errors.Errorf("duration cannot be negative")
	}
	return nil
}
644922
func (s *ThreatIntelIndicator) SetValue(v string) *ThreatIntelIndicator {
	s.Value = &v
	return s
}
1214693
func (d *Duration) Set(s string) error {
	if v, err := strconv.ParseInt(s, 10, 64); err == nil {
		*d = Duration(time.Duration(v) * time.Second)
		return nil
	}

	v, err := time.ParseDuration(s)
	*d = Duration(v)
	return err
}
1194275
func SetLifetime(d time.Duration) Option {
	return func(h *Handler) error {
		h.lifetime = d
		return nil
	}
}
925671
func (c *keyValueChanger) SetValue(value interface{}) (interface{}, error) {
	if c.err != nil {
		return nil, c.err
	}
	current := c.node.content.value()
	c.node.content = keyValue{c.node.content.key(), value}
	return current, nil
}
247520
func (p *protocol) SetOption(option interface{}) *tcpip.Error {
	switch v := option.(type) {
	case SACKEnabled:
		p.mu.Lock()
		p.sackEnabled = bool(v)
		p.mu.Unlock()
		return nil

	case SendBufferSizeOption:
		if v.Min <= 0 || v.Default < v.Min || v.Default > v.Max {
			return tcpip.ErrInvalidOptionValue
		}
		p.mu.Lock()
		p.sendBufferSize = v
		p.mu.Unlock()
		return nil

	case ReceiveBufferSizeOption:
		if v.Min <= 0 || v.Default < v.Min || v.Default > v.Max {
			return tcpip.ErrInvalidOptionValue
		}
		p.mu.Lock()
		p.recvBufferSize = v
		p.mu.Unlock()
		return nil

	case CongestionControlOption:
		for _, c := range p.availableCongestionControl {
			if string(v) == c {
				p.mu.Lock()
				p.congestionControl = string(v)
				p.mu.Unlock()
				return nil
			}
		}
		return tcpip.ErrInvalidOptionValue
	default:
		return tcpip.ErrUnknownProtocolOption
	}
}
43580
func (u *UintValue) Set(v string) error {
	if u.v == nil {
		u.v = new(uint)
	}
	parsed, err := strconv.ParseUint(v, 0, 64)
	*(u.v) = (uint)(parsed)
	return err
}
607080
func (a *StartArgs) SetOptions(options string) *StartArgs {
	a.Options = &options
	return a
}
556517
func (s *ReusableDelegationSetLimit) SetValue(v int64) *ReusableDelegationSetLimit {
	s.Value = &v
	return s
}
506159
func (s *Condition) SetValue(v string) *Condition {
	s.Value = &v
	return s
}
1037980
func (c *keyStringValueChanger) SetValue(value string) (string, error) {
	if c.err != nil {
		return "", c.err
	}
	current := c.node.content.value().(string)
	c.node.content = keyValue{c.node.content.key(), value}
	return current, nil
}
392966
func setValue(rtx *libredis.Tx, key string, expiration time.Duration) (bool, error) {
	value := rtx.SetNX(key, 1, expiration)

	created, err := value.Result()
	if err != nil {
		return false, err
	}

	return created, nil
}
263812
func (t *Term) SetOption(options ...func(*Term) error) error {
	for _, opt := range options {
		if err := opt(t); err != nil {
			return err
		}
	}
	return nil
}
1078678
func (s *AnalysisSchemeStatus) SetOptions(v *AnalysisScheme) *AnalysisSchemeStatus {
	s.Options = v
	return s
}
651699
func (s *FileSystemSize) SetValue(v int64) *FileSystemSize {
	s.Value = &v
	return s
}
265756
func (c *Client) SetTimeout(max time.Duration) {
	atomic.StoreInt64((*int64)(&c.timeout), (int64)(max))
}
985531
func (s *PatchOperation) SetValue(v string) *PatchOperation {
	s.Value = &v
	return s
}