Skip to content

Commit

Permalink
Kept if cond only inside appendComment
Browse files Browse the repository at this point in the history
  • Loading branch information
wwoytenko committed Sep 29, 2024
1 parent 0c86362 commit f748967
Show file tree
Hide file tree
Showing 8 changed files with 8 additions and 24 deletions.
4 changes: 1 addition & 3 deletions orm/composite_create.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,7 @@ func (q *CreateCompositeQuery) AppendTemplate(b []byte) ([]byte, error) {
}

func (q *CreateCompositeQuery) AppendQuery(fmter QueryFormatter, b []byte) ([]byte, error) {
if q.q.comment != "" {
b = appendComment(b, q.q.comment)
}
b = appendComment(b, q.q.comment)
if q.q.stickyErr != nil {
return nil, q.q.stickyErr
}
Expand Down
4 changes: 1 addition & 3 deletions orm/composite_drop.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,7 @@ func (q *DropCompositeQuery) AppendTemplate(b []byte) ([]byte, error) {
}

func (q *DropCompositeQuery) AppendQuery(fmter QueryFormatter, b []byte) ([]byte, error) {
if q.q.comment != "" {
b = appendComment(b, q.q.comment)
}
b = appendComment(b, q.q.comment)
if q.q.stickyErr != nil {
return nil, q.q.stickyErr
}
Expand Down
4 changes: 1 addition & 3 deletions orm/delete.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,7 @@ func (q *DeleteQuery) AppendTemplate(b []byte) ([]byte, error) {
}

func (q *DeleteQuery) AppendQuery(fmter QueryFormatter, b []byte) (_ []byte, err error) {
if q.q.comment != "" {
b = appendComment(b, q.q.comment)
}
b = appendComment(b, q.q.comment)
if q.q.stickyErr != nil {
return nil, q.q.stickyErr
}
Expand Down
4 changes: 1 addition & 3 deletions orm/insert.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,7 @@ func (q *InsertQuery) AppendTemplate(b []byte) ([]byte, error) {
var _ QueryAppender = (*InsertQuery)(nil)

func (q *InsertQuery) AppendQuery(fmter QueryFormatter, b []byte) (_ []byte, err error) {
if q.q.comment != "" {
b = appendComment(b, q.q.comment)
}
b = appendComment(b, q.q.comment)
if q.q.stickyErr != nil {
return nil, q.q.stickyErr
}
Expand Down
4 changes: 1 addition & 3 deletions orm/select.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,7 @@ func (q *SelectQuery) AppendTemplate(b []byte) ([]byte, error) {
}

func (q *SelectQuery) AppendQuery(fmter QueryFormatter, b []byte) (_ []byte, err error) { //nolint:gocyclo
if q.q.comment != "" {
b = appendComment(b, q.q.comment)
}
b = appendComment(b, q.q.comment)
if q.q.stickyErr != nil {
return nil, q.q.stickyErr
}
Expand Down
4 changes: 1 addition & 3 deletions orm/table_create.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,7 @@ func (q *CreateTableQuery) AppendTemplate(b []byte) ([]byte, error) {
}

func (q *CreateTableQuery) AppendQuery(fmter QueryFormatter, b []byte) (_ []byte, err error) {
if q.q.comment != "" {
b = appendComment(b, q.q.comment)
}
b = appendComment(b, q.q.comment)
if q.q.stickyErr != nil {
return nil, q.q.stickyErr
}
Expand Down
4 changes: 1 addition & 3 deletions orm/table_drop.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,7 @@ func (q *DropTableQuery) AppendTemplate(b []byte) ([]byte, error) {
}

func (q *DropTableQuery) AppendQuery(fmter QueryFormatter, b []byte) (_ []byte, err error) {
if q.q.comment != "" {
b = appendComment(b, q.q.comment)
}
b = appendComment(b, q.q.comment)
if q.q.stickyErr != nil {
return nil, q.q.stickyErr
}
Expand Down
4 changes: 1 addition & 3 deletions orm/update.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,7 @@ func (q *UpdateQuery) AppendTemplate(b []byte) ([]byte, error) {
}

func (q *UpdateQuery) AppendQuery(fmter QueryFormatter, b []byte) (_ []byte, err error) {
if q.q.comment != "" {
b = appendComment(b, q.q.comment)
}
b = appendComment(b, q.q.comment)
if q.q.stickyErr != nil {
return nil, q.q.stickyErr
}
Expand Down

0 comments on commit f748967

Please sign in to comment.