Skip to content

Commit

Permalink
Really fix ineffective assigmment in ostack code
Browse files Browse the repository at this point in the history
  • Loading branch information
Scott Daniels committed Jun 7, 2018
1 parent 727e362 commit c5bba4e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions ostack/ostack_net.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,16 +114,16 @@ func (o *Ostack) FetchAllPorts( destfile string ) (err error) {
return
}
url := fmt.Sprintf( "%s/v2.0/ports", *o.nhost )
req, err := http.NewRequest( "GET", url, nil )
if err == nil {
req, nerr := http.NewRequest( "GET", url, nil )
if err = nerr; err == nil {
req.Header.Add( "Content-Type", "application/json" )
req.Header.Add( "X-Auth-Token", o.pickToken() )
rsrc := &http.Client{}
resp, nerr := rsrc.Do( req )
if nerr == nil {
if err = nerr; err == nil {
defer resp.Body.Close()
outf, nerr := os.Create( destfile )
if nerr == nil {
if err = nerr; err == nil {
defer outf.Close()
_, err = io.Copy(outf, resp.Body)
}
Expand Down

0 comments on commit c5bba4e

Please sign in to comment.