MM-31436: Upgrade dependencies (#16605)
* MM-31436: Upgrade dependencies Ran make update-dependencies https://mattermost.atlassian.net/browse/MM-31436 ```release-note NONE ``` * add missing dep * fix lru marshaling
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
09d2f698cc
Коммит
091659c8ad
23
vendor/github.com/getsentry/sentry-go/internal/crypto/randutil/randutil.go
сгенерированный
поставляемый
Обычный файл
23
vendor/github.com/getsentry/sentry-go/internal/crypto/randutil/randutil.go
сгенерированный
поставляемый
Обычный файл
@@ -0,0 +1,23 @@
|
||||
package randutil
|
||||
|
||||
import (
|
||||
"crypto/rand"
|
||||
"encoding/binary"
|
||||
)
|
||||
|
||||
const (
|
||||
floatMax = 1 << 53
|
||||
floatMask = floatMax - 1
|
||||
)
|
||||
|
||||
// Float64 returns a cryptographically secure random number in [0.0, 1.0).
|
||||
func Float64() float64 {
|
||||
// The implementation is, in essence:
|
||||
// return float64(rand.Int63n(1<<53)) / (1<<53)
|
||||
b := make([]byte, 8)
|
||||
_, err := rand.Read(b)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return float64(binary.LittleEndian.Uint64(b)&floatMask) / floatMax
|
||||
}
|
||||
45
vendor/github.com/getsentry/sentry-go/internal/debug/transport.go
сгенерированный
поставляемый
Обычный файл
45
vendor/github.com/getsentry/sentry-go/internal/debug/transport.go
сгенерированный
поставляемый
Обычный файл
@@ -0,0 +1,45 @@
|
||||
package debug
|
||||
|
||||
import (
|
||||
"io"
|
||||
"net/http"
|
||||
"net/http/httputil"
|
||||
)
|
||||
|
||||
// Transport implements http.RoundTripper and can be used to wrap other HTTP
|
||||
// transports to dump request and responses for debugging.
|
||||
type Transport struct {
|
||||
http.RoundTripper
|
||||
Output io.Writer
|
||||
}
|
||||
|
||||
func (t *Transport) RoundTrip(req *http.Request) (*http.Response, error) {
|
||||
b, err := httputil.DumpRequestOut(req, true)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
_, err = t.Output.Write(ensureTrailingNewline(b))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
resp, err := t.RoundTripper.RoundTrip(req)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
b, err = httputil.DumpResponse(resp, true)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
_, err = t.Output.Write(ensureTrailingNewline(b))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return resp, nil
|
||||
}
|
||||
|
||||
func ensureTrailingNewline(b []byte) []byte {
|
||||
if len(b) > 0 && b[len(b)-1] != '\n' {
|
||||
b = append(b, '\n')
|
||||
}
|
||||
return b
|
||||
}
|
||||
Ссылка в новой задаче
Block a user