mirror of
https://github.com/pgsty/minio.git
synced 2026-07-19 20:20:25 +03:00
fix: remove all unused code (#12360)
This commit is contained in:
@@ -78,8 +78,6 @@ func TestMain(m *testing.M) {
|
||||
SecretKey: auth.DefaultSecretKey,
|
||||
}
|
||||
|
||||
globalConfigEncrypted = true
|
||||
|
||||
// disable ENVs which interfere with tests.
|
||||
for _, env := range []string{
|
||||
crypto.EnvKMSAutoEncryption,
|
||||
@@ -1278,35 +1276,6 @@ func getRandomBucketName() string {
|
||||
|
||||
}
|
||||
|
||||
// NewEOFWriter returns a Writer that writes to w,
|
||||
// but returns EOF error after writing n bytes.
|
||||
func NewEOFWriter(w io.Writer, n int64) io.Writer {
|
||||
return &EOFWriter{w, n}
|
||||
}
|
||||
|
||||
type EOFWriter struct {
|
||||
w io.Writer
|
||||
n int64
|
||||
}
|
||||
|
||||
// io.Writer implementation designed to error out with io.EOF after reading `n` bytes.
|
||||
func (t *EOFWriter) Write(p []byte) (n int, err error) {
|
||||
if t.n <= 0 {
|
||||
return -1, io.EOF
|
||||
}
|
||||
// real write
|
||||
n = len(p)
|
||||
if int64(n) > t.n {
|
||||
n = int(t.n)
|
||||
}
|
||||
n, err = t.w.Write(p[0:n])
|
||||
t.n -= int64(n)
|
||||
if err == nil {
|
||||
n = len(p)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// construct URL for http requests for bucket operations.
|
||||
func makeTestTargetURL(endPoint, bucketName, objectName string, queryValues url.Values) string {
|
||||
urlStr := endPoint + SlashSeparator
|
||||
|
||||
Reference in New Issue
Block a user