Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
packer
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kristopher Ruzic
packer
Commits
0f5ef2ce
Commit
0f5ef2ce
authored
Oct 28, 2014
by
Mitchell Hashimoto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
command/push: close reader
parent
fbc15510
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
3 deletions
+3
-3
command/push.go
command/push.go
+1
-0
command/push_test.go
command/push_test.go
+2
-3
No files found.
command/push.go
View file @
0f5ef2ce
...
@@ -83,6 +83,7 @@ func (c *PushCommand) Run(args []string) int {
...
@@ -83,6 +83,7 @@ func (c *PushCommand) Run(args []string) int {
c
.
Ui
.
Error
(
fmt
.
Sprintf
(
"Error archiving: %s"
,
err
))
c
.
Ui
.
Error
(
fmt
.
Sprintf
(
"Error archiving: %s"
,
err
))
return
1
return
1
}
}
defer
r
.
Close
()
// Start the upload process
// Start the upload process
doneCh
,
uploadErrCh
,
err
:=
c
.
upload
(
r
,
&
uploadOpts
)
doneCh
,
uploadErrCh
,
err
:=
c
.
upload
(
r
,
&
uploadOpts
)
...
...
command/push_test.go
View file @
0f5ef2ce
...
@@ -29,10 +29,10 @@ func TestPush_multiArgs(t *testing.T) {
...
@@ -29,10 +29,10 @@ func TestPush_multiArgs(t *testing.T) {
}
}
func
TestPush
(
t
*
testing
.
T
)
{
func
TestPush
(
t
*
testing
.
T
)
{
var
actual
R
io
.
Reader
var
actual
[]
string
var
actualOpts
*
uploadOpts
var
actualOpts
*
uploadOpts
uploadFn
:=
func
(
r
io
.
Reader
,
opts
*
uploadOpts
)
(
<-
chan
struct
{},
<-
chan
error
,
error
)
{
uploadFn
:=
func
(
r
io
.
Reader
,
opts
*
uploadOpts
)
(
<-
chan
struct
{},
<-
chan
error
,
error
)
{
actual
R
=
r
actual
=
testArchive
(
t
,
r
)
actualOpts
=
opts
actualOpts
=
opts
doneCh
:=
make
(
chan
struct
{})
doneCh
:=
make
(
chan
struct
{})
...
@@ -50,7 +50,6 @@ func TestPush(t *testing.T) {
...
@@ -50,7 +50,6 @@ func TestPush(t *testing.T) {
fatalCommand
(
t
,
c
.
Meta
)
fatalCommand
(
t
,
c
.
Meta
)
}
}
actual
:=
testArchive
(
t
,
actualR
)
expected
:=
[]
string
{
expected
:=
[]
string
{
archiveTemplateEntry
,
archiveTemplateEntry
,
"template.json"
,
"template.json"
,
...
...
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