
Security News
Opengrep Adds Apex Support and New Rule Controls in Latest Updates
The latest Opengrep releases add Apex scanning, precision rule tuning, and performance gains for open source static code analysis.
go.winto.dev/handler
Package handler provide new signature for handling http request.
stdlib Handler signature is func(http.ResponseWriter, *http.Request)
, and it is not convenience to write branching inside it.
For example:
func h(w http.ResponseWriter, r *http.Request) {
if ... {
http.Error(w, "some error 1", 500)
// it will be disaster if we forget this return
return
}
...
if ... {
http.Error(w, "some error 2", 500)
// it will be disaster if we forget this return
return
}
...
fmt.Fprintln(w, "some data")
}
we can rewrite it like this to force developer to return when the branch of the code end:
func h(r *http.Request) http.HandlerFunc {
if ... {
return defresponse.Text(500, "some error 1")
}
...
if ... {
return defresponse.Text(500, "some error 2")
}
...
// will compile error if we forget return
return defresponse.Text(200, "some data")
}
FAQs
Unknown package
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
The latest Opengrep releases add Apex scanning, precision rule tuning, and performance gains for open source static code analysis.
Security News
npm now supports Trusted Publishing with OIDC, enabling secure package publishing directly from CI/CD workflows without relying on long-lived tokens.
Research
/Security News
A RubyGems malware campaign used 60 malicious packages posing as automation tools to steal credentials from social media and marketing tool users.