mirror of
				https://github.com/go-gitea/gitea.git
				synced 2025-10-31 19:06:18 +01:00 
			
		
		
		
	Less naked returns (#25713)
just a step towards #25655 and some related refactoring
This commit is contained in:
		| @@ -224,3 +224,12 @@ func TestToTitleCase(t *testing.T) { | ||||
| 	assert.Equal(t, ToTitleCase(`foo bar baz`), `Foo Bar Baz`) | ||||
| 	assert.Equal(t, ToTitleCase(`FOO BAR BAZ`), `Foo Bar Baz`) | ||||
| } | ||||
|  | ||||
| func TestToPointer(t *testing.T) { | ||||
| 	assert.Equal(t, "abc", *ToPointer("abc")) | ||||
| 	assert.Equal(t, 123, *ToPointer(123)) | ||||
| 	abc := "abc" | ||||
| 	assert.False(t, &abc == ToPointer(abc)) | ||||
| 	val123 := 123 | ||||
| 	assert.False(t, &val123 == ToPointer(val123)) | ||||
| } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user