Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
arduino-cli
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Operations
Operations
Metrics
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
xpstem
arduino-cli
Commits
7b2b350f
Commit
7b2b350f
authored
Oct 31, 2018
by
Cristian Maglie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updated downloader lib
parent
c9d47b49
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
5 deletions
+13
-5
Gopkg.lock
Gopkg.lock
+2
-2
vendor/go.bug.st/downloader/downloader.go
vendor/go.bug.st/downloader/downloader.go
+11
-3
No files found.
Gopkg.lock
View file @
7b2b350f
...
...
@@ -389,11 +389,11 @@
[[projects]]
branch = "master"
digest = "1:
800e8a12373d3ba53e397e356f83582722368aea8160167dfb646c26989e1f4
d"
digest = "1:
5cd3c0f530ab660c7b08f563020dc00b8e761c2f7650457a3f669b6601f7f28
d"
name = "go.bug.st/downloader"
packages = ["."]
pruneopts = "UT"
revision = "6
aab51b4c847ce8d86cff12649db295afc1739a9
"
revision = "6
0d736642c5c2252f6d19016d7e68178b19478f0
"
[[projects]]
branch = "master"
...
...
vendor/go.bug.st/downloader/downloader.go
View file @
7b2b350f
...
...
@@ -20,7 +20,7 @@ type Downloader struct {
URL
string
Done
chan
bool
resp
*
http
.
Response
out
io
.
Writer
out
*
os
.
File
completed
int64
size
int64
err
error
...
...
@@ -36,7 +36,15 @@ const (
// Close the download
func
(
d
*
Downloader
)
Close
()
error
{
return
d
.
resp
.
Body
.
Close
()
err1
:=
d
.
out
.
Close
()
err2
:=
d
.
resp
.
Body
.
Close
()
if
err1
!=
nil
{
return
fmt
.
Errorf
(
"closing output file: %s"
,
err1
)
}
if
err2
!=
nil
{
return
fmt
.
Errorf
(
"closing input stream: %s"
,
err2
)
}
return
nil
}
// Size return the size of the download
...
...
@@ -81,8 +89,8 @@ func (d *Downloader) AsyncRun() {
break
}
}
d
.
Done
<-
true
d
.
Close
()
d
.
Done
<-
true
}
// Run starts the downloader and waits until it completes the download.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment