dependabot[bot] on go_modules
chore(deps): bump github.com/st… (compare)
go get -u github.com/gin-gonic/gin # cd .; git clone -- https://gopkg.in/yaml.v2 /Users/jt/golib/src/gopkg.in/yaml.v2 Cloning into '/Users/jt/golib/src/gopkg.in/yaml.v2'... fatal: unable to access 'https://gopkg.in/yaml.v2/': SSL certificate problem: certificate has expired package gopkg.in/yaml.v2: exit status 128
go get github.com/gin-contrib/sessionsis returning
../../firstname.lastname@example.org/session_options_go1.10.go:1:1: expected 'package', found 'EOF'
I am writing a simple API with gin. routes / request / response all good. Now, i am trying to add some debugs into the route. I know i can
log.Print() the messages, but with that, i will not have the context (request id, request body / method etc). I tried looking up a logger middleware that can accept any debug message (
log.Print("Working on request" + param.Request.Body)).. but i can't seem to find any. All that said, question: How i can print debug message within a route, such that it has the context, and any debug messages i left in the route? Any example would be great!
200without a body. The code this happens in can be found here: https://github.com/LearningBay24/LearningBay24-backend/blob/7dd8de4d378ff2249b4d72fc81916891cefbf05b/api/api.go#L641=
ctx.Header("Content-Type", "application/octet-stream") ctx.Header("Content-Disposition", "attachment; filename=your file name") ctx.Header("Content-Disposition", "inline;filename=your file name") ctx.Header("Content-Transfer-Encoding", "binary") ctx.Header("Cache-Control", "no-cache") ctx.File(your file path)