Merge lp:~dave-cheney/goose/100-fix-vet-errors into lp:goose
Proposed by
Dave Cheney
Status: | Merged |
---|---|
Approved by: | Dave Cheney |
Approved revision: | 127 |
Merged at revision: | 124 |
Proposed branch: | lp:~dave-cheney/goose/100-fix-vet-errors |
Merge into: | lp:goose |
Diff against target: |
123 lines (+19/-25) 6 files modified
nova/json.go (+8/-9) testservices/cmd/main.go (+1/-2) testservices/identityservice/keypair.go (+4/-6) testservices/identityservice/userpass.go (+4/-6) testservices/novaservice/service_http.go (+1/-1) tools/secgroup-delete-all/main_test.go (+1/-1) |
To merge this branch: | bzr merge lp:~dave-cheney/goose/100-fix-vet-errors |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Juju Engineering | Pending | ||
Review via email: mp+219781@code.launchpad.net |
Commit message
goose: fix vet errors
* fix several printf errors
* address unreachable code warnings. Rewrote branches to avoid unreachable code while being compatible with Go 1.0
Description of the change
goose: fix vet errors
* fix several printf errors
* address unreachable code warnings. Rewrote branches to avoid unreachable code while being compatible with Go 1.0
To post a comment you must log in.
Reviewers: mp+219781_ code.launchpad. net,
Message:
Please take a look.
Description:
goose: fix vet errors
* fix several printf errors
* address unreachable code warnings. Rewrote branches to avoid
unreachable code while being compatible with Go 1.0
https:/ /code.launchpad .net/~dave- cheney/ goose/100- fix-vet- errors/ +merge/ 219781
(do not edit description out of merge proposal)
Please review this at https:/ /codereview. appspot. com/96360045/
Affected files (+21, -25 lines): cmd/main. go identityservice /keypair. go identityservice /userpass. go novaservice/ service_ http.go delete- all/main_ test.go
A [revision details]
M nova/json.go
M testservices/
M testservices/
M testservices/
M testservices/
M tools/secgroup-
Index: [revision details] 20140513085629- 73yp1ik7s2wh2u5 o
=== added file '[revision details]'
--- [revision details] 2012-01-01 00:00:00 +0000
+++ [revision details] 2012-01-01 00:00:00 +0000
@@ -0,0 +1,2 @@
+Old revision: tarmac-
+New revision: <email address hidden>
Index: nova/json.go int(floatVal) ), nil unreachable" ) int(floatVal) ), nil
=== modified file 'nova/json.go'
--- nova/json.go 2013-06-26 02:55:42 +0000
+++ nova/json.go 2014-05-16 06:16:12 +0000
@@ -43,16 +43,15 @@
if err := json.Unmarshal(b, &out); err != nil {
return "", err
}
- if val, ok := out[tag]; !ok {
+ val, ok := out[tag]
+ if !ok {
return "", nil
- } else {
- if floatVal, ok := val.(float64); ok {
- return fmt.Sprint(
- } else {
- return fmt.Sprint(val), nil
- }
- }
- panic("
+ }
+ floatVal, ok := val.(float64)
+ if ok {
+ return fmt.Sprint(
+ }
+ return fmt.Sprint(val), nil
}
// appendJSON marshals the given attribute value and appends it as an
encoded value to the given json data.
Index: testservices/ cmd/main. go cmd/main. go' cmd/main. go 2013-01-24 03:15:19 +0000 cmd/main. go 2014-05-16 06:10:03 +0000
=== modified file 'testservices/
--- testservices/
+++ testservices/
@@ -38,7 +38,6 @@
var users userValues
func init() { Var(&users, "user", "supply to add a user to the identity secret: token\" .")
-
gnuflag.
provider. Can be supplied multiple times. Should be of the form
\"user:
}
@@ -59,7 +58,7 @@ Parse(true) *provider]
gnuflag.
p, ok := providerMap[
if !ok {
- log.Fatalf("No such provider: %s, pick one of: %v", provider,
providers())
+ log.Fatalf("No such provider: %s, pick one of: %v", *provider,
providers())
}
mux := http.NewServeMux()
p.SetupHTTP(mux)
Index: testservices/ identityservice /keypair. go identityservice /keypair. go' identityservice /keypair. go 2013-05-21 01:07:40 +0000 identityservice /keypair. go 2014-05-16 06:12:51 +0000 lure(w, http.StatusInte rnalServerError , err.Error()) lure(w, http.StatusInte rnalServerError , err.Error()) http.StatusOK) unreachable" ) http.StatusOK)
=== modified file 'testservices/
--- testservices/
+++ testservices/
@@ -90,15 +90,13 @@
u.ReturnFai
return
}
- if content, err := json.Marshal(res); err != nil {
+ content, err := json.Marshal(res)
+ if err != nil {
u.ReturnFai
return
- } else {
- w.WriteHeader(
- w.Write(content)
- return
}
- panic("
+ w.WriteHeader(
+ w.Write(content)
}
func (u *KeyPair) ...