mirror of
				https://github.com/superseriousbusiness/gotosocial.git
				synced 2025-10-30 15:42:25 -05:00 
			
		
		
		
	[chore] Use generic pointer function (#2080)
This replaces the different $TypePtr functions with a generic implementation.
This commit is contained in:
		
					parent
					
						
							
								517829ae6a
							
						
					
				
			
			
				commit
				
					
						be3718f6e4
					
				
			
		
					 22 changed files with 393 additions and 391 deletions
				
			
		|  | @ -28,6 +28,7 @@ import ( | |||
| 	apimodel "github.com/superseriousbusiness/gotosocial/internal/api/model" | ||||
| 	"github.com/superseriousbusiness/gotosocial/internal/gtsmodel" | ||||
| 	"github.com/superseriousbusiness/gotosocial/internal/media" | ||||
| 	"github.com/superseriousbusiness/gotosocial/internal/util" | ||||
| 	"github.com/superseriousbusiness/gotosocial/testrig" | ||||
| ) | ||||
| 
 | ||||
|  | @ -68,7 +69,7 @@ func (suite *GetFileTestSuite) TestGetRemoteFileUncached() { | |||
| 
 | ||||
| 	// uncache the file from local | ||||
| 	testAttachment := suite.testAttachments["remote_account_1_status_1_attachment_1"] | ||||
| 	testAttachment.Cached = testrig.FalseBool() | ||||
| 	testAttachment.Cached = util.Ptr(false) | ||||
| 	err := suite.db.UpdateByID(ctx, testAttachment, testAttachment.ID, "cached") | ||||
| 	suite.NoError(err) | ||||
| 	err = suite.storage.Delete(ctx, testAttachment.File.Path) | ||||
|  | @ -120,7 +121,7 @@ func (suite *GetFileTestSuite) TestGetRemoteFileUncachedInterrupted() { | |||
| 
 | ||||
| 	// uncache the file from local | ||||
| 	testAttachment := suite.testAttachments["remote_account_1_status_1_attachment_1"] | ||||
| 	testAttachment.Cached = testrig.FalseBool() | ||||
| 	testAttachment.Cached = util.Ptr(false) | ||||
| 	err := suite.db.UpdateByID(ctx, testAttachment, testAttachment.ID, "cached") | ||||
| 	suite.NoError(err) | ||||
| 	err = suite.storage.Delete(ctx, testAttachment.File.Path) | ||||
|  | @ -177,7 +178,7 @@ func (suite *GetFileTestSuite) TestGetRemoteFileThumbnailUncached() { | |||
| 	suite.NoError(err) | ||||
| 
 | ||||
| 	// uncache the file from local | ||||
| 	testAttachment.Cached = testrig.FalseBool() | ||||
| 	testAttachment.Cached = util.Ptr(false) | ||||
| 	err = suite.db.UpdateByID(ctx, testAttachment, testAttachment.ID, "cached") | ||||
| 	suite.NoError(err) | ||||
| 	err = suite.storage.Delete(ctx, testAttachment.File.Path) | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue