Skip to content

Commit

Permalink
Fixes for the linter, massive godoc update
Browse files Browse the repository at this point in the history
  • Loading branch information
disq committed Dec 2, 2016
1 parent 09bfd15 commit 7ee75de
Show file tree
Hide file tree
Showing 12 changed files with 183 additions and 135 deletions.
13 changes: 13 additions & 0 deletions context.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package main

// ExitFuncKey is the key name of the exit function in context
const ExitFuncKey = contextKey("exitFunc")

// CancelFuncKey is the key name of the cancel function in context
const CancelFuncKey = contextKey("cancelFunc")

type contextKey string

func (c contextKey) String() string {
return "s5cmd context key " + string(c)
}
2 changes: 2 additions & 0 deletions error.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"strings"
)

// IsRetryableError returns if an error (probably awserr) is retryable, along with an error code
func IsRetryableError(err error) (string, bool) {
if err != nil {
if awsErr, ok := err.(awserr.Error); ok {
Expand Down Expand Up @@ -36,6 +37,7 @@ func IsRetryableError(err error) (string, bool) {
return "", false
}

// CleanupError converts multiline error messages generated by aws-sdk-go into a single line
func CleanupError(err error) (s string) {
s = strings.Replace(err.Error(), "\n", " ", -1)
s = strings.Replace(s, "\t", " ", -1)
Expand Down
Loading

0 comments on commit 7ee75de

Please sign in to comment.