aboutsummaryrefslogtreecommitdiff
path: root/vendor/github.com/magiconair/properties/load.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/github.com/magiconair/properties/load.go')
-rw-r--r--vendor/github.com/magiconair/properties/load.go8
1 files changed, 5 insertions, 3 deletions
diff --git a/vendor/github.com/magiconair/properties/load.go b/vendor/github.com/magiconair/properties/load.go
index 4300fec..701a86d 100644
--- a/vendor/github.com/magiconair/properties/load.go
+++ b/vendor/github.com/magiconair/properties/load.go
@@ -1,4 +1,4 @@
-// Copyright 2016 Frank Schroeder. All rights reserved.
+// Copyright 2017 Frank Schroeder. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
@@ -98,7 +98,7 @@ func MustLoadURL(url string) *Properties {
return must(LoadURL(url))
}
-// MustLoadFiles reads the content of multiple URLs in the given order into a
+// MustLoadURLs reads the content of multiple URLs in the given order into a
// Properties struct and panics on error. If 'ignoreMissing' is true then a 404
// status code will not be reported as error.
func MustLoadURLs(urls []string, ignoreMissing bool) *Properties {
@@ -172,10 +172,12 @@ func loadURL(url string, ignoreMissing bool) (*Properties, error) {
return nil, fmt.Errorf("properties: %s returned %d", url, resp.StatusCode)
}
body, err := ioutil.ReadAll(resp.Body)
- resp.Body.Close()
if err != nil {
return nil, fmt.Errorf("properties: %s error reading response. %s", url, err)
}
+ if err = resp.Body.Close(); err != nil {
+ return nil, fmt.Errorf("properties: %s error reading response. %s", url, err)
+ }
ct := resp.Header.Get("Content-Type")
var enc Encoding