[MM-61082] Fix errcheck issues in license_test.go (#30617)

* [MM-28754] Fix errcheck issues in license_test.go

- Properly handle error returned from os.WriteFile
- Remove license_test.go from errcheck exceptions list in .golangci.yml

Fixes https://github.com/mattermost/mattermost/issues/28754

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>

* Remove empty line

---------

Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
Ben Schumacher 2025-04-14 09:28:28 +02:00 committed by GitHub
parent 02c7678438
commit 4d0109feeb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 2 additions and 2 deletions

View file

@ -160,7 +160,6 @@ issues:
channels/store/storetest/team_store.go|\
channels/store/storetest/thread_store.go|\
channels/store/storetest/user_store.go|\
channels/utils/license_test.go|\
channels/web/oauth_test.go|\
channels/web/saml.go|\
channels/web/web_test.go|\

View file

@ -112,7 +112,8 @@ func TestGetLicenseFileFromDisk(t *testing.T) {
f, err := os.CreateTemp("", "TestGetLicenseFileFromDisk")
require.NoError(t, err)
defer os.Remove(f.Name())
os.WriteFile(f.Name(), []byte("not a license"), 0777)
err = os.WriteFile(f.Name(), []byte("not a license"), 0777)
require.NoError(t, err)
fileBytes := GetLicenseFileFromDisk(f.Name())
require.NotEmpty(t, fileBytes, "should have read the file")