Skip to content

Commit 72f5ef1

Browse files
committed
Cleanup code
1 parent 577cf54 commit 72f5ef1

File tree

3 files changed

+5
-29
lines changed

3 files changed

+5
-29
lines changed

cmd/image/qcow2ova/password-generator.go

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,10 @@ import (
2020
)
2121

2222
// GeneratePassword generates the password of length n
23-
func GeneratePassword(n int) (b64Password string, err error) {
23+
func GeneratePassword(n int) (string, error) {
2424
b := make([]byte, n)
25-
_, err = rand.Read(b)
26-
if err != nil {
27-
return
25+
if _, err := rand.Read(b); err != nil {
26+
return "", err
2827
}
29-
b64Password = base64.URLEncoding.EncodeToString(b)
30-
return
28+
return base64.URLEncoding.EncodeToString(b), nil
3129
}

pkg/client/events/events.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ import (
2020
"github.com/IBM-Cloud/power-go-client/ibmpisession"
2121
"github.com/IBM-Cloud/power-go-client/power/client/p_cloud_events"
2222
"github.com/IBM/go-sdk-core/v5/core"
23-
"github.com/ppc64le-cloud/pvsadm/pkg"
2423
)
2524

2625
type Client struct {
@@ -38,6 +37,6 @@ func NewClient(sess *ibmpisession.IBMPISession, powerinstanceid string) *Client
3837
}
3938

4039
func (c *Client) GetPcloudEventsGetsince(since time.Duration) (*p_cloud_events.PcloudEventsGetqueryOK, error) {
41-
params := p_cloud_events.NewPcloudEventsGetqueryParamsWithTimeout(pkg.TIMEOUT).WithCloudInstanceID(c.instanceID).WithFromTime(core.StringPtr(time.Now().UTC().Add(-since).Format(time.RFC3339)))
40+
params := p_cloud_events.NewPcloudEventsGetqueryParams().WithCloudInstanceID(c.instanceID).WithFromTime(core.StringPtr(time.Now().UTC().Add(-since).Format(time.RFC3339)))
4241
return c.client.PcloudEventsGetquery(params, c.session.AuthInfo(c.instanceID))
4342
}

pkg/types.go

Lines changed: 0 additions & 21 deletions
This file was deleted.

0 commit comments

Comments
 (0)