[PR #309] [MERGED] use t.Cleanup and prefer assert.NoError over .Nil #1408

Closed
opened 2026-03-01 21:51:03 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/nektos/act/pull/309
Author: @trashhalo
Created: 7/18/2020
Status: Merged
Merged: 7/20/2020
Merged by: @cplee

Base: masterHead: cleanup-git-test


📝 Commits (2)

  • 0ba8309 use t.Cleanup and prefer assert.NoError over .Nil
  • 2815667 Merge branch 'master' into cleanup-git-test

📊 Changes

1 file changed (+14 additions, -14 deletions)

View changed files

📝 pkg/common/git_test.go (+14 -14)

📄 Description

testify has a method NoError that is specifically for asserting that the err you have is nil. If failed it emits a message about the unexpected error. https://github.com/stretchr/testify/blob/master/assert/assertions.go#L1332

go 1.14 introduced t.Cleanup its useful when you need to do something at the end of a test. Like cleaning up files.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/nektos/act/pull/309 **Author:** [@trashhalo](https://github.com/trashhalo) **Created:** 7/18/2020 **Status:** ✅ Merged **Merged:** 7/20/2020 **Merged by:** [@cplee](https://github.com/cplee) **Base:** `master` ← **Head:** `cleanup-git-test` --- ### 📝 Commits (2) - [`0ba8309`](https://github.com/nektos/act/commit/0ba8309d8c5b666ecd4d1fc7980d230ca370be53) use t.Cleanup and prefer assert.NoError over .Nil - [`2815667`](https://github.com/nektos/act/commit/281566714465df43e130a3ccbb6aab2e0079fc8d) Merge branch 'master' into cleanup-git-test ### 📊 Changes **1 file changed** (+14 additions, -14 deletions) <details> <summary>View changed files</summary> 📝 `pkg/common/git_test.go` (+14 -14) </details> ### 📄 Description testify has a method [NoError](https://godoc.org/github.com/stretchr/testify/assert#NoError) that is specifically for asserting that the err you have is nil. If failed it emits a message about the unexpected error. https://github.com/stretchr/testify/blob/master/assert/assertions.go#L1332 go 1.14 introduced [t.Cleanup](https://golang.org/pkg/testing/#B.Cleanup) its useful when you need to do something at the end of a test. Like cleaning up files. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-01 21:51:03 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/act#1408
No description provided.