Simplify literals (after running gofmt -s over the code)

This commit is contained in:
Nick Craig-Wood 2016-02-29 16:57:23 +00:00
parent 9c263e3e2b
commit 88cca8a6eb
4 changed files with 32 additions and 32 deletions

View File

@ -103,7 +103,7 @@ type hashTest struct {
} }
var hashTestSet = []hashTest{ var hashTestSet = []hashTest{
hashTest{ {
input: []byte{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14}, input: []byte{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14},
output: map[fs.HashType]string{ output: map[fs.HashType]string{
fs.HashMD5: "bf13fc19e5151ac57d4252e0e0f87abe", fs.HashMD5: "bf13fc19e5151ac57d4252e0e0f87abe",
@ -111,7 +111,7 @@ var hashTestSet = []hashTest{
}, },
}, },
// Empty data set // Empty data set
hashTest{ {
input: []byte{}, input: []byte{},
output: map[fs.HashType]string{ output: map[fs.HashType]string{
fs.HashMD5: "d41d8cd98f00b204e9800998ecf8427e", fs.HashMD5: "d41d8cd98f00b204e9800998ecf8427e",

View File

@ -23,7 +23,7 @@ func init() {
Name: "local", Name: "local",
Description: "Local Disk", Description: "Local Disk",
NewFs: NewFs, NewFs: NewFs,
Options: []fs.Option{fs.Option{ Options: []fs.Option{{
Name: "nounc", Name: "nounc",
Help: "Disable UNC (long path names) conversion on Windows", Help: "Disable UNC (long path names) conversion on Windows",
Optional: true, Optional: true,

View File

@ -52,9 +52,9 @@ func TestUncPaths(t *testing.T) {
} }
var utf8Tests = [][2]string{ var utf8Tests = [][2]string{
[2]string{"ABC", "ABC"}, {"ABC", "ABC"},
[2]string{string([]byte{0x80}), "<22>"}, {string([]byte{0x80}), "<22>"},
[2]string{string([]byte{'a', 0x80, 'b'}), "a<>b"}, {string([]byte{'a', 0x80, 'b'}), "a<>b"},
} }
func TestCleanUtf8(t *testing.T) { func TestCleanUtf8(t *testing.T) {
@ -71,13 +71,13 @@ func TestCleanUtf8(t *testing.T) {
// Test Windows character replacements // Test Windows character replacements
var testsWindows = [][2]string{ var testsWindows = [][2]string{
[2]string{`c:\temp`, `c:\temp`}, {`c:\temp`, `c:\temp`},
[2]string{`\\?\UNC\theserver\dir\file.txt`, `\\?\UNC\theserver\dir\file.txt`}, {`\\?\UNC\theserver\dir\file.txt`, `\\?\UNC\theserver\dir\file.txt`},
[2]string{`//?/UNC/theserver/dir\file.txt`, `//?/UNC/theserver/dir\file.txt`}, {`//?/UNC/theserver/dir\file.txt`, `//?/UNC/theserver/dir\file.txt`},
[2]string{"c:/temp", "c:/temp"}, {"c:/temp", "c:/temp"},
[2]string{"/temp/file.txt", "/temp/file.txt"}, {"/temp/file.txt", "/temp/file.txt"},
[2]string{`!\"#¤%&/()=;:*^?+-`, "!\\_#¤%&/()=;__^_+-"}, {`!\"#¤%&/()=;:*^?+-`, "!\\_#¤%&/()=;__^_+-"},
[2]string{`<>"|?*:&\<>"|?*:&\<>"|?*:&`, "_______&\\_______&\\_______&"}, {`<>"|?*:&\<>"|?*:&\<>"|?*:&`, "_______&\\_______&\\_______&"},
} }
func TestCleanWindows(t *testing.T) { func TestCleanWindows(t *testing.T) {

View File

@ -14,25 +14,25 @@ import (
// URL parameters that need to be added to the signature // URL parameters that need to be added to the signature
var s3ParamsToSign = map[string]struct{}{ var s3ParamsToSign = map[string]struct{}{
"acl": struct{}{}, "acl": {},
"location": struct{}{}, "location": {},
"logging": struct{}{}, "logging": {},
"notification": struct{}{}, "notification": {},
"partNumber": struct{}{}, "partNumber": {},
"policy": struct{}{}, "policy": {},
"requestPayment": struct{}{}, "requestPayment": {},
"torrent": struct{}{}, "torrent": {},
"uploadId": struct{}{}, "uploadId": {},
"uploads": struct{}{}, "uploads": {},
"versionId": struct{}{}, "versionId": {},
"versioning": struct{}{}, "versioning": {},
"versions": struct{}{}, "versions": {},
"response-content-type": struct{}{}, "response-content-type": {},
"response-content-language": struct{}{}, "response-content-language": {},
"response-expires": struct{}{}, "response-expires": {},
"response-cache-control": struct{}{}, "response-cache-control": {},
"response-content-disposition": struct{}{}, "response-content-disposition": {},
"response-content-encoding": struct{}{}, "response-content-encoding": {},
} }
// sign signs requests using v2 auth // sign signs requests using v2 auth