chore(gonf): removed opinionated static checkers

This commit is contained in:
Julien Dessaux 2024-06-02 01:17:36 +02:00
parent efbfb291ae
commit 4a254746de
Signed by: adyxax
GPG key ID: F92E51B86E07177E
10 changed files with 56 additions and 86 deletions

View file

@ -14,20 +14,19 @@ type Value interface {
}
func interfaceToValue(v any) Value {
if vv, ok := v.([]byte); ok {
switch vv := v.(type) {
case []byte:
return &BytesValue{vv}
}
if vv, ok := v.(int); ok {
case int:
return &IntValue{vv}
}
if vv, ok := v.(string); ok {
case string:
return &StringValue{vv}
}
if vv, ok := v.(*VariablePromise); ok {
case *VariablePromise:
return vv
default:
slog.Error("interfaceToValue", "value", v, "error", "Not Implemented")
panic(fmt.Sprintf("interfaceToValue cannot take type %T as argument. Value was %#v.", v, v))
}
slog.Error("interfaceToValue", "value", v, "error", "Not Implemented")
panic(fmt.Sprintf("interfaceToValue cannot take type %T as argument. Value was %#v.", v, v))
}
func interfaceToTemplateValue(v any) Value {