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")),
|
||||
)
|
||||
|
||||
urlToSearch := fmt.Sprintf(
|
||||
"%s://%s:%s%s",
|
||||
scheme,
|
||||
host,
|
||||
port,
|
||||
ctx.RequestURI(),
|
||||
)
|
||||
row := stmt.QueryRow(
|
||||
string(ctx.Method()),
|
||||
fmt.Sprintf(
|
||||
"%s://%s:%s%s",
|
||||
scheme,
|
||||
host,
|
||||
port,
|
||||
ctx.RequestURI(),
|
||||
),
|
||||
urlToSearch,
|
||||
)
|
||||
|
||||
// log.Println(urlToSearch)
|
||||
|
||||
var id int
|
||||
var code int
|
||||
|
||||
|
|
Loading…
Reference in a new issue