[go: up one dir, main page]

Skip to content

Commit

Permalink
Remove Redundant Spacing
Browse files Browse the repository at this point in the history
  • Loading branch information
rizalgowandy committed May 8, 2022
1 parent 5698e57 commit 7d840ff
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions loader.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import (
_ "github.com/rizalgowandy/gdk/pkg/jsonx"
_ "github.com/rizalgowandy/gdk/pkg/logx"
_ "github.com/rizalgowandy/gdk/pkg/netx"
_ "github.com/rizalgowandy/gdk/pkg/pagination"
_ "github.com/rizalgowandy/gdk/pkg/password"
_ "github.com/rizalgowandy/gdk/pkg/pprofx"
_ "github.com/rizalgowandy/gdk/pkg/queue/nsqx"
Expand Down
4 changes: 4 additions & 0 deletions pkg/logx/pgx.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (

"github.com/jackc/pgx/v4"
"github.com/rizalgowandy/gdk/pkg/errorx/v2"
"github.com/rizalgowandy/gdk/pkg/regex"
)

func NewPGX() *PGX {
Expand All @@ -30,6 +31,9 @@ func (p *PGX) Log(
if ok {
query = strings.ReplaceAll(query, "\t", " ")
query = strings.ReplaceAll(query, "\n", " ")
if sanitized, replaceErr := regex.ReplaceAllString(`\s+`, query, " "); replaceErr == nil {
query = sanitized
}
data["sql"] = query
}
}
Expand Down

0 comments on commit 7d840ff

Please sign in to comment.