chore: fix warnings (#3990)

This commit is contained in:
Kevin Wan
2024-03-09 13:48:11 +08:00
committed by GitHub
parent 159ecb7386
commit e9e55125a9
16 changed files with 39 additions and 37 deletions

View File

@@ -60,7 +60,8 @@ func executeCallbacks(w http.ResponseWriter, r *http.Request, next http.Handler,
}
}
func handleVerificationFailure(w http.ResponseWriter, r *http.Request, next http.Handler, strict bool, code int) {
func handleVerificationFailure(w http.ResponseWriter, r *http.Request, next http.Handler,
strict bool, _ int) {
if strict {
w.WriteHeader(http.StatusForbidden)
} else {

View File

@@ -327,7 +327,7 @@ func buildRequest(rs requestSettings) (*http.Request, error) {
query,
bodySign,
}, "\n")
rs.signature = codec.HmacBase64([]byte(key), contentOfSign)
rs.signature = codec.HmacBase64(key, contentOfSign)
}
var mode string

View File

@@ -224,7 +224,7 @@ func (m flushableResponseWriter) Write(p []byte) (int, error) {
return m.writer.Write(p)
}
func (m flushableResponseWriter) WriteHeader(statusCode int) {
func (m flushableResponseWriter) WriteHeader(_ int) {
panic("implement me")
}
@@ -240,6 +240,6 @@ func (t *halfWriter) Write(p []byte) (n int, err error) {
type badWriter struct {
}
func (b *badWriter) Write(p []byte) (n int, err error) {
func (b *badWriter) Write(_ []byte) (n int, err error) {
return 0, io.ErrClosedPipe
}

View File

@@ -164,7 +164,7 @@ type mockedReadCloser struct {
errMsg string
}
func (m mockedReadCloser) Read(p []byte) (n int, err error) {
func (m mockedReadCloser) Read(_ []byte) (n int, err error) {
return 0, errors.New(m.errMsg)
}