refactor: move Sprintf-generation of url
out of func args
allows much better debugging + some readability
This commit is contained in:
parent
f08b63fa61
commit
b1d2ba896c
1 changed files with 10 additions and 7 deletions
17
server.go
17
server.go
|
@ -58,17 +58,20 @@ func handler(ctx *fasthttp.RequestCtx) {
|
||||||
bytes.Equal(scheme, []byte("https")),
|
bytes.Equal(scheme, []byte("https")),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
urlToSearch := fmt.Sprintf(
|
||||||
|
"%s://%s:%s%s",
|
||||||
|
scheme,
|
||||||
|
host,
|
||||||
|
port,
|
||||||
|
ctx.RequestURI(),
|
||||||
|
)
|
||||||
row := stmt.QueryRow(
|
row := stmt.QueryRow(
|
||||||
string(ctx.Method()),
|
string(ctx.Method()),
|
||||||
fmt.Sprintf(
|
urlToSearch,
|
||||||
"%s://%s:%s%s",
|
|
||||||
scheme,
|
|
||||||
host,
|
|
||||||
port,
|
|
||||||
ctx.RequestURI(),
|
|
||||||
),
|
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// log.Println(urlToSearch)
|
||||||
|
|
||||||
var id int
|
var id int
|
||||||
var code int
|
var code int
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue