Compare commits

...

3 Commits

Author SHA1 Message Date
ab1a1ab6f6 v0.0.293 fix NPE
All checks were successful
Build Docker and Deploy / Run goext test-suite (push) Successful in 1m52s
2023-10-30 13:37:31 +01:00
19ee5019ef v0.0.292
All checks were successful
Build Docker and Deploy / Run goext test-suite (push) Successful in 3m11s
2023-10-30 10:14:38 +01:00
42b68507f2 v0.0.291
All checks were successful
Build Docker and Deploy / Run goext test-suite (push) Successful in 56s
2023-10-26 13:02:45 +02:00
4 changed files with 25 additions and 4 deletions

View File

@@ -264,7 +264,7 @@ func fmtCSIDOutput(cs string, ids []CSIDDef, pkgname string) string {
str += ` checkstr := string(idCharset[checksum%idCharsetLen])` + "\n" str += ` checkstr := string(idCharset[checksum%idCharsetLen])` + "\n"
str += "\n" str += "\n"
str += ` if !strings.HasSuffix(value, checkstr) {` + "\n" str += ` if !strings.HasSuffix(value, checkstr) {` + "\n"
str += ` return exerr.New(exerr.ErrInvalidCSID, "id checkstring is invalid").Str("value", value).Str("checkstr", checkstr).Build()` + "\n" str += ` return exerr.New(exerr.TypeInvalidCSID, "id checkstring is invalid").Str("value", value).Str("checkstr", checkstr).Build()` + "\n"
str += ` }` + "\n" str += ` }` + "\n"
str += "\n" str += "\n"
str += ` return nil` + "\n" str += ` return nil` + "\n"

View File

@@ -275,7 +275,7 @@ func (b *Builder) Any(key string, val any) *Builder {
} }
func (b *Builder) Stringer(key string, val fmt.Stringer) *Builder { func (b *Builder) Stringer(key string, val fmt.Stringer) *Builder {
if val == nil { if langext.IsNil(val) {
return b.addMeta(key, MDTString, "(!nil)") return b.addMeta(key, MDTString, "(!nil)")
} else { } else {
return b.addMeta(key, MDTString, val.String()) return b.addMeta(key, MDTString, val.String())

View File

@@ -1,5 +1,5 @@
package goext package goext
const GoextVersion = "0.0.290" const GoextVersion = "0.0.293"
const GoextVersionTimestamp = "2023-10-26T13:01:58+0200" const GoextVersionTimestamp = "2023-10-30T13:37:31+0100"

21
tst/must.go Normal file
View File

@@ -0,0 +1,21 @@
package tst
import (
"runtime/debug"
"testing"
)
// Must can b used to AssertNoErr of an (T, err) function
//
// Usage:
//
// input := "123.8"
// value := tst.Must(strconv.Atoi(input))(t)
func Must[T any](v T, anerr error) func(t *testing.T) T {
return func(t *testing.T) T {
if anerr != nil {
t.Error("Function returned an error: " + anerr.Error() + "\n" + string(debug.Stack()))
}
return v
}
}