Skip to content

Commit

Permalink
Remove New from constructor function name.
Browse files Browse the repository at this point in the history
  • Loading branch information
Cedric BAIL committed May 16, 2023
1 parent 581e79d commit c1ab1bc
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
12 changes: 6 additions & 6 deletions data/binding/bool.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ type not struct {

var _ Bool = (*not)(nil)

// NewNot returns a Bool binding that invert the value of the given data binding.
// Not returns a Bool binding that invert the value of the given data binding.
// This is providing the logical Not boolean operation as a data binding.
//
// Since 2.4
func NewNot(data Bool) Bool {
func Not(data Bool) Bool {
return &not{Bool: data}
}

Expand All @@ -29,13 +29,13 @@ type and struct {

var _ Bool = (*and)(nil)

// NewAnd returns a Bool binding that return true when all the passed Bool binding are
// And returns a Bool binding that return true when all the passed Bool binding are
// true and false otherwise. It does apply a logical and boolean operation on all passed
// Bool bindings. This binding is two way. In case of a Set, it will propagate the value
// identically to all the Bool bindings used for its construction.
//
// Since 2.4
func NewAnd(data ...Bool) Bool {
func And(data ...Bool) Bool {
return &and{booleans: booleans{data: data}}
}

Expand Down Expand Up @@ -68,13 +68,13 @@ type or struct {

var _ Bool = (*or)(nil)

// NewOr returns a Bool binding that return true when at least one of the passed Bool binding
// Or returns a Bool binding that return true when at least one of the passed Bool binding
// is true and false otherwise. It does apply a logical or boolean operation on all passed
// Bool bindings. This binding is two way. In case of a Set, it will propagate the value
// identically to all the Bool bindings used for its construction.
//
// Since 2.4
func NewOr(data ...Bool) Bool {
func Or(data ...Bool) Bool {
return &or{booleans: booleans{data: data}}
}

Expand Down
6 changes: 3 additions & 3 deletions data/binding/bool_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ func TestNot(t *testing.T) {
var b bool = true

bb := BindBool(&b)
notbb := NewNot(bb)
notbb := Not(bb)

assert.NotNil(t, bb)
assert.NotNil(t, notbb)
Expand All @@ -34,7 +34,7 @@ func TestAnd(t *testing.T) {
bb = append(bb, BindBool(&b[idx]))
}

andbb := NewAnd(bb...)
andbb := And(bb...)
assert.NotNil(t, andbb)

setAtOffset := func(offset, value int) {
Expand Down Expand Up @@ -75,7 +75,7 @@ func TestOr(t *testing.T) {
bb = append(bb, BindBool(&b[idx]))
}

andbb := NewOr(bb...)
andbb := Or(bb...)
assert.NotNil(t, andbb)

setAtOffset := func(offset, value int) {
Expand Down

0 comments on commit c1ab1bc

Please sign in to comment.