init - add project files

This commit is contained in:
2025-03-06 23:54:11 -05:00
commit e724ff1120
1363 changed files with 897467 additions and 0 deletions

View File

@@ -0,0 +1,41 @@
package must
import (
"github.com/go-jet/jet/v2/internal/utils/is"
"reflect"
)
// BeTrue panics when condition is false
func BeTrue(condition bool, errorStr string) {
if !condition {
panic(errorStr)
}
}
// BeTypeKind panics with errorStr error, if v interface is not of reflect kind
func BeTypeKind(v interface{}, kind reflect.Kind, errorStr string) {
if reflect.TypeOf(v).Kind() != kind {
panic(errorStr)
}
}
// ValueBeOfTypeKind panics with errorStr error, if v value is not of reflect kind
func ValueBeOfTypeKind(v reflect.Value, kind reflect.Kind, errorStr string) {
if v.Kind() != kind {
panic(errorStr)
}
}
// TypeBeOfKind panics with errorStr error, if v type is not of reflect kind
func TypeBeOfKind(v reflect.Type, kind reflect.Kind, errorStr string) {
if v.Kind() != kind {
panic(errorStr)
}
}
// BeInitializedPtr panics with errorStr if val interface is nil
func BeInitializedPtr(val interface{}, errorStr string) {
if is.Nil(val) {
panic(errorStr)
}
}