go fmt
This commit is contained in:
@@ -126,15 +126,15 @@ func processS3Bucket(s3Config *S3Config, opts *indexgen.Options) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
entry := indexgen.FileEntry{
|
entry := indexgen.FileEntry{
|
||||||
Name: keyName,
|
Name: keyName,
|
||||||
Path: keyName,
|
Path: keyName,
|
||||||
IsDir: false,
|
IsDir: false,
|
||||||
Size: *obj.Size,
|
Size: *obj.Size,
|
||||||
ModTime: *obj.LastModified,
|
ModTime: *obj.LastModified,
|
||||||
IsSymlink: false,
|
IsSymlink: false,
|
||||||
IconType: indexgen.GetIconType(keyName),
|
IconType: indexgen.GetIconType(keyName),
|
||||||
SizePretty: indexgen.PrettySize(*obj.Size),
|
SizePretty: indexgen.PrettySize(*obj.Size),
|
||||||
ModTimeISO: obj.LastModified.Format("2006-01-02T15:04:05Z"),
|
ModTimeISO: obj.LastModified.Format("2006-01-02T15:04:05Z"),
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set CSS class based on file type
|
// Set CSS class based on file type
|
||||||
|
|||||||
@@ -150,28 +150,28 @@ func TestS3FlagHandling(t *testing.T) {
|
|||||||
|
|
||||||
func TestMutualExclusionAndRequiredFlags(t *testing.T) {
|
func TestMutualExclusionAndRequiredFlags(t *testing.T) {
|
||||||
tests := []struct {
|
tests := []struct {
|
||||||
name string
|
name string
|
||||||
args []string
|
args []string
|
||||||
shouldExitWithError bool
|
shouldExitWithError bool
|
||||||
}{
|
}{
|
||||||
{
|
{
|
||||||
name: "no flags provided",
|
name: "no flags provided",
|
||||||
args: []string{"s3-genindex"},
|
args: []string{"s3-genindex"},
|
||||||
shouldExitWithError: true,
|
shouldExitWithError: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "directory flag only",
|
name: "directory flag only",
|
||||||
args: []string{"s3-genindex", "-d", "/tmp"},
|
args: []string{"s3-genindex", "-d", "/tmp"},
|
||||||
shouldExitWithError: false,
|
shouldExitWithError: false,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "s3 flag only",
|
name: "s3 flag only",
|
||||||
args: []string{"s3-genindex", "-s3", "http://example.com/bucket"},
|
args: []string{"s3-genindex", "-s3", "http://example.com/bucket"},
|
||||||
shouldExitWithError: false,
|
shouldExitWithError: false,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "both flags provided (mutual exclusion)",
|
name: "both flags provided (mutual exclusion)",
|
||||||
args: []string{"s3-genindex", "-d", "/tmp", "-s3", "http://example.com/bucket"},
|
args: []string{"s3-genindex", "-d", "/tmp", "-s3", "http://example.com/bucket"},
|
||||||
shouldExitWithError: true,
|
shouldExitWithError: true,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user