Skip to content

Commit

Permalink
Change package naming
Browse files Browse the repository at this point in the history
  • Loading branch information
disq committed Dec 1, 2016
1 parent 0b6039b commit 3a25427
Show file tree
Hide file tree
Showing 12 changed files with 25 additions and 24 deletions.
4 changes: 3 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
BINS=s5cmd

include go.mk

s5cmd: ${SRCDIR}/cmd/s5cmd/main.go ${SRCDIR}/*.go
s5cmd: ${SRCDIR}/*.go
${GOROOT}/bin/go build ${GCFLAGS} -ldflags "${LDFLAGS}" ./$(<D)
2 changes: 1 addition & 1 deletion error.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package s5cmd
package main

import (
"fmt"
Expand Down
2 changes: 1 addition & 1 deletion job.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package s5cmd
package main

import (
"context"
Expand Down
2 changes: 1 addition & 1 deletion job_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package s5cmd
package main

import (
"context"
Expand Down
19 changes: 9 additions & 10 deletions cmd/s5cmd/main.go → main.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import (
"flag"
"fmt"
"github.com/aws/aws-sdk-go/service/s3/s3manager"
"github.com/peakgames/s5cmd"
"log"
"math"
"os"
Expand Down Expand Up @@ -74,7 +73,7 @@ func main() {
if flag.Arg(0) == "" && cmdFile == "" {
printUsageLine()
fmt.Fprint(os.Stderr, "Commands:\n")
fmt.Fprintf(os.Stderr, s5cmd.GetCommandList())
fmt.Fprintf(os.Stderr, GetCommandList())
fmt.Fprint(os.Stderr, "\nTo list available options, run with the -h option.\n")
os.Exit(2)
}
Expand Down Expand Up @@ -130,10 +129,10 @@ func main() {
cancelFunc()
}()

s := s5cmd.Stats{}
s := Stats{}

wp := s5cmd.NewWorkerPool(ctx,
&s5cmd.WorkerPoolParams{
wp := NewWorkerPool(ctx,
&WorkerPoolParams{
NumWorkers: uint32(numWorkers),
ChunkSizeBytes: multipartChunkSizeBytes,
Retries: retries,
Expand All @@ -146,7 +145,7 @@ func main() {

elapsed := time.Since(startTime)

failops := s.Get(s5cmd.STATS_FAIL)
failops := s.Get(STATS_FAIL)

// if exitCode is -1 (default) and if we have at least one absolute-fail, exit with code 127
if exitCode == -1 {
Expand All @@ -162,10 +161,10 @@ func main() {
}

if !cmdMode || *printStats {
s3ops := s.Get(s5cmd.STATS_S3OP)
fileops := s.Get(s5cmd.STATS_FILEOP)
shellops := s.Get(s5cmd.STATS_SHELLOP)
retryops := s.Get(s5cmd.STATS_RETRYOP)
s3ops := s.Get(STATS_S3OP)
fileops := s.Get(STATS_FILEOP)
shellops := s.Get(STATS_SHELLOP)
retryops := s.Get(STATS_RETRYOP)
printOps("S3", s3ops, elapsed, "")
printOps("File", fileops, elapsed, "")
printOps("Shell", shellops, elapsed, "")
Expand Down
2 changes: 1 addition & 1 deletion operation.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package s5cmd
package main

import (
"fmt"
Expand Down
2 changes: 1 addition & 1 deletion parse.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package s5cmd
package main

import (
"errors"
Expand Down
8 changes: 4 additions & 4 deletions parse_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package s5cmd
package main

import (
"path/filepath"
Expand Down Expand Up @@ -250,8 +250,8 @@ func TestParseFileDir(t *testing.T) {
input := filepath.Join("path", "to", "obj") + string(filepath.Separator)
testParseGeneral(t, typ, input, input, false, true, "", "", nil)
})
t.Run("cmd", func(t *testing.T) {
testParseGeneral(t, typ, "cmd", "cmd/", false, true, "", "", nil)
t.Run("existing-dir", func(t *testing.T) {
testParseGeneral(t, typ, "vendor", "vendor/", false, true, "", "", nil)
})
t.Run("path/to/obj", func(t *testing.T) {
input := filepath.Join("path", "to", "obj")
Expand All @@ -278,7 +278,7 @@ func TestParseFileOrDir(t *testing.T) {
testParseGeneral(t, typ, input, input, false, true, "", "", nil)
})
t.Run("Existing-dir-without-slash", func(t *testing.T) {
testParseGeneral(t, typ, "cmd", "cmd"+string(filepath.Separator), false, true, "", "", nil)
testParseGeneral(t, typ, "vendor", "vendor"+string(filepath.Separator), false, true, "", "", nil)
})
t.Run("path/to/obj*", func(t *testing.T) {
input := filepath.Join("path", "to", "obj*")
Expand Down
2 changes: 1 addition & 1 deletion s3.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package s5cmd
package main

import (
"context"
Expand Down
2 changes: 1 addition & 1 deletion scan.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package s5cmd
package main

import (
"bufio"
Expand Down
2 changes: 1 addition & 1 deletion stats.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package s5cmd
package main

import "sync/atomic"

Expand Down
2 changes: 1 addition & 1 deletion worker.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package s5cmd
package main

import (
"context"
Expand Down

0 comments on commit 3a25427

Please sign in to comment.