-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Fix file size upload param * Fix vendor * Fix? * Query file size only once * Revert unintentional change
- Loading branch information
Showing
20 changed files
with
729 additions
and
67 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,13 @@ | ||
package uploaders | ||
|
||
import ( | ||
"fmt" | ||
"math" | ||
|
||
"github.com/bitrise-io/go-utils/pathutil" | ||
"os" | ||
) | ||
|
||
func round(f float64) float64 { | ||
return math.Floor(f + .5) | ||
} | ||
|
||
func roundPlus(f float64, places int) float64 { | ||
shift := math.Pow(10, float64(places)) | ||
return round(f*shift) / shift | ||
} | ||
|
||
func fileSizeInBytes(pth string) (float64, error) { | ||
info, exist, err := pathutil.PathCheckAndInfos(pth) | ||
func fileSizeInBytes(pth string) (int64, error) { | ||
finfo, err := os.Stat(pth) | ||
if err != nil { | ||
return 0, err | ||
} | ||
if !exist { | ||
return 0, fmt.Errorf("file not exist at: %s", pth) | ||
} | ||
return float64(info.Size()), nil | ||
return finfo.Size(), nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.