mirror of
https://github.com/go-gitea/gitea.git
synced 2025-07-21 01:21:18 +02:00
Start to migrate from util.OptionalBool
to optional.Option[bool]
(#29329)
just create transition helper and migrate two structs
This commit is contained in:
@@ -6,8 +6,6 @@ package optional
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"code.gitea.io/gitea/modules/util"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
@@ -30,7 +28,8 @@ func TestOption(t *testing.T) {
|
||||
var ptr *int
|
||||
assert.False(t, FromPtr(ptr).Has())
|
||||
|
||||
opt1 := FromPtr(util.ToPointer(1))
|
||||
int1 := 1
|
||||
opt1 := FromPtr(&int1)
|
||||
assert.True(t, opt1.Has())
|
||||
assert.Equal(t, int(1), opt1.Value())
|
||||
|
||||
|
Reference in New Issue
Block a user