mattermost/server/public/utils
Jesse Hallam e3fbf8711f
MM-68149: Upgrade to Go 1.26.2 (#36418)
* MM-68149: upgrade to Go 1.26.2

Update go directive in go.mod and .go-version.

* MM-68149: replace pointer helpers with Go 1.26 new()

Go 1.26 extends the built-in new() to accept an initial value expression,
making typed-pointer helpers like model.NewPointer(x), bToP(x), and boolPtr(x)
redundant. Replace every call site with new(x) and remove the now-unused
helper functions and their //go:fix inline directives.

* MM-68149: apply go fix for reflect API and format-string changes

- reflect.Ptr → reflect.Pointer (renamed in Go 1.18, deprecated alias removed in 1.26)
- reflect range-over-struct: for i := 0; i < t.NumField(); i++ → for field := range t.Fields()
  and the equivalent for Methods() and interface types
- Fix format-string concatenation and variadic-arg mismatches flagged by go vet

* MM-68149: update JPEG fixtures and test infrastructure for Go 1.26 encoder

Go 1.26 ships a new image/jpeg encoder that produces slightly different output.
Regenerate all JPEG fixture files and switch the comparison helpers from
byte-equality to pixel-level comparison with a small per-channel tolerance,
so minor encoder drift across patch versions is handled automatically.

Add -update-fixtures flag to make it easy to regenerate fixtures after future
major Go upgrades. Document the update procedure in tests/README.md.

* MM-68149: CI check that go fix ./... produces no changes

* Fix real bugs flagged by CodeRabbit review

- group.go: set newGroup.MemberCount not group.MemberCount (member count
  was populated on the wrong variable and lost before publish/return)
- file_test.go: guard compareImage(GetFilePreview) on the preview slice
  length, not the thumbnail slice length (copy-paste error)
- config_test.go: remove duplicate MinimumLength assignment

* fixup! Fix real bugs flagged by CodeRabbit review
2026-05-12 15:59:12 +00:00
..
sql MM-63368: Remove MySQL (#33458) 2025-07-22 20:40:55 +05:30
timeutils [MM-54288] Support Packet V2 (#29403) 2025-01-13 20:23:09 +01:00
array.go Feature edit attachments (#29769) 2025-01-13 18:16:56 +05:30
array_test.go Feature edit attachments (#29769) 2025-01-13 18:16:56 +05:30
file.go Improve error message for failed file copied (#30418) 2025-03-19 19:48:26 +01:00
file_test.go Expose public/ API as submodule (#23345) 2023-05-10 13:07:02 -03:00
fileutils.go [MM-54288] Support Packet V2 (#29403) 2025-01-13 20:23:09 +01:00
fileutils_test.go ci: enable fullyparallel mode for server tests (#35816) 2026-04-08 20:48:36 -04:00
json.go MM-57378: Bump up golangci version (#26535) 2024-03-22 10:23:21 +05:30
json_test.go MM-68149: Upgrade to Go 1.26.2 (#36418) 2026-05-12 15:59:12 +00:00
page.go MM-60441: Re-index public channels when a user joins a team (#33400) 2025-08-25 19:28:19 +02:00
page_test.go MM-60441: Re-index public channels when a user joins a team (#33400) 2025-08-25 19:28:19 +02:00