Skip to content

Commit

Permalink
pr: fmt go files according golangci-lint err
Browse files Browse the repository at this point in the history
Signed-off-by: Qi Feng Huo <huoqif@cn.ibm.com>
  • Loading branch information
Qi Feng Huo committed Sep 28, 2023
1 parent 982507a commit 3fea11a
Show file tree
Hide file tree
Showing 9 changed files with 17 additions and 10 deletions.
1 change: 1 addition & 0 deletions .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ jobs:
# When `install-mode` is `binary` (default) the value can be v1.2 or v1.2.3 or `latest` to use the latest version.
# When `install-mode` is `goinstall` the value can be v1.2.3, `latest`, or the hash of a commit.
version: v1.54
args: --out-format=colored-line-number

# Optional: working directory, useful for monorepos
# working-directory: somedir
Expand Down
9 changes: 5 additions & 4 deletions pkg/zhmcclient/client.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

// Copyright 2021-2023 IBM Corp. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
Expand Down Expand Up @@ -36,8 +37,8 @@ import (
)

func NewZapLogger() Logger {
zapLogger, _ := zap.NewProduction()
return zapLogger
zapLogger, _ := zap.NewProduction()
return zapLogger
}

var logger = NewZapLogger()
Expand Down Expand Up @@ -107,8 +108,8 @@ type Client struct {
func NewClient(endpoint string, opts *Options, l Logger) (ClientAPI, *HmcError) {

if l != nil {
logger = l
}
logger = l
}

tslConfig, err := SetCertificate(opts, &tls.Config{})
if err != nil {
Expand Down
1 change: 1 addition & 0 deletions pkg/zhmcclient/cpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import (
)

// CpcAPI defines an interface for issuing CPC requests to ZHMC
//
//go:generate counterfeiter -o fakes/cpc.go --fake-name CpcAPI . CpcAPI
type CpcAPI interface {
ListCPCs(query map[string]string) ([]CPC, int, *HmcError)
Expand Down
1 change: 1 addition & 0 deletions pkg/zhmcclient/job.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import (
)

// JobAPI defines an interface for issuing Job requests to ZHMC
//
//go:generate counterfeiter -o fakes/job.go --fake-name JobAPI . JobAPI
type JobAPI interface {
QueryJob(jobURI string) (*Job, int, *HmcError)
Expand Down
1 change: 0 additions & 1 deletion pkg/zhmcclient/logger.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import (
"go.uber.org/zap/zapcore"
)


type Logger interface {
Debug(msg string, fields ...zapcore.Field)
Info(msg string, fields ...zapcore.Field)
Expand Down
1 change: 1 addition & 0 deletions pkg/zhmcclient/lpar.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import (
)

// LparAPI defines an interface for issuing LPAR requests to ZHMC
//
//go:generate counterfeiter -o fakes/lpar.go --fake-name LparAPI . LparAPI
type LparAPI interface {
CreateLPAR(cpcURI string, props *LparProperties) (string, int, *HmcError)
Expand Down
1 change: 1 addition & 0 deletions pkg/zhmcclient/nic.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import (
)

// NicAPI defines an interface for issuing NIC requests to ZHMC
//
//go:generate counterfeiter -o fakes/nic.go --fake-name NicAPI . NicAPI
type NicAPI interface {
CreateNic(lparURI string, nic *NIC) (string, int, *HmcError)
Expand Down
11 changes: 6 additions & 5 deletions pkg/zhmcclient/sgroup.go
Original file line number Diff line number Diff line change
Expand Up @@ -266,11 +266,12 @@ func (m *StorageGroupManager) UpdateStorageGroupProperties(storageGroupURI strin
return status, nil
}

/**
* POST /api/storage-groups/{storage-group-id}/operations/accept-mismatched-
storage-volumes
* Return: 200
* or: 400, 404, 409
/*
*
- POST /api/storage-groups/{storage-group-id}/operations/accept-mismatched-
storage-volumes
- Return: 200
- or: 400, 404, 409
*/
func (m *StorageGroupManager) FulfillStorageGroup(storageGroupURI string, request *StorageGroupProperties) (int, *HmcError) {
requestUrl := m.client.CloneEndpointURL()
Expand Down
1 change: 1 addition & 0 deletions pkg/zhmcclient/vswitch.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import (
)

// VirtualSwitchAPI defines an interface for issuing VirtualSwitch requests to ZHMC
//
//go:generate counterfeiter -o fakes/vswitch.go --fake-name VirtualSwitchAPI . VirtualSwitchAPI
type VirtualSwitchAPI interface {
ListVirtualSwitches(cpcURI string, query map[string]string) ([]VirtualSwitch, int, *HmcError)
Expand Down

0 comments on commit 3fea11a

Please sign in to comment.