Skip to content

Commit

Permalink
dev: introduce must setting
Browse files Browse the repository at this point in the history
  • Loading branch information
sunsingerus committed Oct 3, 2024
1 parent 4cf2cc0 commit 0ce604e
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions pkg/apis/clickhouse.altinity.com/v1/type_setting_scalar.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,15 @@ func NewSettingScalarFromAny(untyped any) (*Setting, bool) {
return nil, false
}

// MustNewSettingScalarFromAny makes new scalar Setting from untyped
func MustNewSettingScalarFromAny(untyped any) *Setting {
if scalar, ok := parseSettingScalarValue(untyped); ok {
return NewSettingScalar(scalar)
}

return nil
}

const (
// Float with fractional part less than ignoreThreshold is considered to be int and is casted to int
ignoreThreshold = 0.001
Expand Down

0 comments on commit 0ce604e

Please sign in to comment.