mirror of
https://github.com/minio/minio.git
synced 2025-11-07 04:42:56 -05:00
Add deadcode code which recursivley goes into all directories and verifies dangling variables.
This commit is contained in:
@@ -40,6 +40,10 @@ func (server *minioApi) listObjectsHandler(w http.ResponseWriter, req *http.Requ
|
||||
return
|
||||
}
|
||||
|
||||
if resources.Maxkeys == 0 {
|
||||
resources.Maxkeys = maxObjectList
|
||||
}
|
||||
|
||||
acceptsContentType := getContentType(req)
|
||||
objects, resources, err := server.storage.ListObjects(bucket, resources)
|
||||
switch err := err.(type) {
|
||||
|
||||
@@ -22,7 +22,7 @@ import (
|
||||
|
||||
// Limit number of objects in a given response
|
||||
const (
|
||||
MAX_OBJECT_LIST = 1000
|
||||
maxObjectList = 1000
|
||||
)
|
||||
|
||||
// Object list response format
|
||||
|
||||
@@ -36,8 +36,8 @@ type DataHeader struct {
|
||||
type EncoderTechnique int
|
||||
|
||||
const (
|
||||
VANDERMONDE EncoderTechnique = iota
|
||||
CAUCHY
|
||||
Vandermonde EncoderTechnique = iota
|
||||
Cauchy
|
||||
)
|
||||
|
||||
type EncoderParams struct {
|
||||
|
||||
@@ -39,7 +39,7 @@ func (s *MySuite) TestSingleWrite(c *C) {
|
||||
Length: uint32(len(testData)),
|
||||
K: 8,
|
||||
M: 8,
|
||||
Technique: CAUCHY,
|
||||
Technique: Cauchy,
|
||||
}
|
||||
metadata := make(Metadata)
|
||||
metadata["Content-Type"] = "application/octet-stream"
|
||||
|
||||
@@ -29,7 +29,7 @@ var _ = Suite(&MySuite{})
|
||||
func Test(t *testing.T) { TestingT(t) }
|
||||
|
||||
func (s *MySuite) TestCauchyDecode(c *C) {
|
||||
ep, _ := ParseEncoderParams(10, 5, CAUCHY)
|
||||
ep, _ := ParseEncoderParams(10, 5, Cauchy)
|
||||
|
||||
data := []byte("Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.")
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
// ParseEncoderParams(k, m, technique int) (EncoderParams, error)
|
||||
// k - Number of rows in matrix
|
||||
// m - Number of colums in matrix
|
||||
// technique - Matrix type, can be either CAUCHY (recommended) or VANDERMONDE
|
||||
// technique - Matrix type, can be either Cauchy (recommended) or Vandermonde
|
||||
// constraints: k + m < Galois Field (2^8)
|
||||
//
|
||||
// Choosing right parity and matrix technique is left for application to decide.
|
||||
@@ -53,14 +53,14 @@
|
||||
//
|
||||
// Creating and using an encoder
|
||||
// var bytes []byte
|
||||
// params := erasure.ParseEncoderParams(10, 5, erasure.CAUCHY)
|
||||
// params := erasure.ParseEncoderParams(10, 5, erasure.Cauchy)
|
||||
// encoder := erasure.NewEncoder(params)
|
||||
// encodedData, length := encoder.Encode(bytes)
|
||||
//
|
||||
// Creating and using a decoder
|
||||
// var encodedData [][]byte
|
||||
// var length int
|
||||
// params := erasure.ParseEncoderParams(10, 5, erasure.CAUCHY)
|
||||
// params := erasure.ParseEncoderParams(10, 5, erasure.Cauchy)
|
||||
// encoder := erasure.NewEncoder(params)
|
||||
// originalData, err := encoder.Decode(encodedData, length)
|
||||
//
|
||||
|
||||
@@ -29,8 +29,8 @@ import (
|
||||
type Technique int
|
||||
|
||||
const (
|
||||
VANDERMONDE Technique = iota
|
||||
CAUCHY
|
||||
Vandermonde Technique = iota
|
||||
Cauchy
|
||||
)
|
||||
|
||||
const (
|
||||
@@ -59,7 +59,7 @@ type Encoder struct {
|
||||
// ParseEncoderParams creates an EncoderParams object.
|
||||
//
|
||||
// k and m represent the matrix size, which corresponds to the protection level
|
||||
// technique is the matrix type. Valid inputs are CAUCHY (recommended) or VANDERMONDE.
|
||||
// technique is the matrix type. Valid inputs are Cauchy (recommended) or Vandermonde.
|
||||
//
|
||||
func ParseEncoderParams(k, m uint8, technique Technique) (*EncoderParams, error) {
|
||||
if k < 1 {
|
||||
@@ -75,9 +75,9 @@ func ParseEncoderParams(k, m uint8, technique Technique) (*EncoderParams, error)
|
||||
}
|
||||
|
||||
switch technique {
|
||||
case VANDERMONDE:
|
||||
case Vandermonde:
|
||||
break
|
||||
case CAUCHY:
|
||||
case Cauchy:
|
||||
break
|
||||
default:
|
||||
return nil, errors.New("Technique can be either vandermonde or cauchy")
|
||||
|
||||
@@ -26,16 +26,6 @@ import "unsafe"
|
||||
|
||||
var (
|
||||
// See http://golang.org/ref/spec#Numeric_types
|
||||
|
||||
// SizeUint8 is the byte size of a uint8.
|
||||
sizeUint8 = int(unsafe.Sizeof(uint8(0)))
|
||||
// SizeUint16 is the byte size of a uint16.
|
||||
sizeUint16 = int(unsafe.Sizeof(uint16(0)))
|
||||
// SizeUint32 is the byte size of a uint32.
|
||||
sizeUint32 = int(unsafe.Sizeof(uint32(0)))
|
||||
// SizeUint64 is the byte size of a uint64.
|
||||
sizeUint64 = int(unsafe.Sizeof(uint64(0)))
|
||||
|
||||
sizeInt = int(C.sizeInt())
|
||||
// SizeInt8 is the byte size of a int8.
|
||||
sizeInt8 = int(unsafe.Sizeof(int8(0)))
|
||||
|
||||
@@ -22,7 +22,7 @@ import (
|
||||
)
|
||||
|
||||
func (s *MySuite) TestVanderMondeDecode(c *C) {
|
||||
ep, _ := ParseEncoderParams(10, 5, VANDERMONDE)
|
||||
ep, _ := ParseEncoderParams(10, 5, Vandermonde)
|
||||
|
||||
data := []byte("Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user