Update to go 1.26.0 and golangci-lint 2.9.0 (#36588)

This commit is contained in:
silverwind
2026-02-11 18:37:13 +01:00
committed by GitHub
parent 3754e9dd12
commit 45ee571693
30 changed files with 95 additions and 130 deletions
-5
View File
@@ -197,11 +197,6 @@ func ToFloat64(number any) (float64, error) {
return value, nil
}
// ToPointer returns the pointer of a copy of any given value
func ToPointer[T any](val T) *T {
return &val
}
// Iif is an "inline-if", it returns "trueVal" if "condition" is true, otherwise "falseVal"
func Iif[T any](condition bool, trueVal, falseVal T) T {
if condition {
-9
View File
@@ -212,15 +212,6 @@ func TestToTitleCase(t *testing.T) {
assert.Equal(t, `Foo Bar Baz`, ToTitleCase(`FOO BAR BAZ`))
}
func TestToPointer(t *testing.T) {
assert.Equal(t, "abc", *ToPointer("abc"))
assert.Equal(t, 123, *ToPointer(123))
abc := "abc"
assert.NotSame(t, &abc, ToPointer(abc))
val123 := 123
assert.NotSame(t, &val123, ToPointer(val123))
}
func TestReserveLineBreakForTextarea(t *testing.T) {
assert.Equal(t, "test\ndata", ReserveLineBreakForTextarea("test\r\ndata"))
assert.Equal(t, "test\ndata\n", ReserveLineBreakForTextarea("test\r\ndata\r\n"))