mirror of
https://github.com/minio/minio.git
synced 2025-11-07 21:02:58 -05:00
Add constants for commonly used values. (#3588)
This is a consolidation effort, avoiding usage of naked strings in codebase. Whenever possible use constants which can be repurposed elsewhere. This also fixes `goconst ./...` reported issues.
This commit is contained in:
@@ -40,11 +40,11 @@ func newHashWriters(diskCount int, algo string) []hash.Hash {
|
||||
// newHash - gives you a newly allocated hash depending on the input algorithm.
|
||||
func newHash(algo string) (h hash.Hash) {
|
||||
switch algo {
|
||||
case "sha256":
|
||||
case sha256Algo:
|
||||
// sha256 checksum specially on ARM64 platforms or whenever
|
||||
// requested as dictated by `xl.json` entry.
|
||||
h = sha256.New()
|
||||
case "blake2b":
|
||||
case blake2bAlgo:
|
||||
// ignore the error, because New512 without a key never fails
|
||||
// New512 only returns a non-nil error, if the length of the passed
|
||||
// key > 64 bytes - but we use blake2b as hash function (no key)
|
||||
|
||||
Reference in New Issue
Block a user