Skip to content

Commit

Permalink
Debug Linter Error
Browse files Browse the repository at this point in the history
  • Loading branch information
TYuan0816 committed Jan 26, 2024
1 parent f826954 commit e9ba650
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 18 deletions.
3 changes: 2 additions & 1 deletion internal/sbi/consumer/nf_discovery.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ func SendSearchNFInstances(nrfUri string, targetNfType, requestNfType models.NfT
configuration.SetBasePath(nrfUri)
client := Nnrf_NFDiscovery.NewAPIClient(configuration)

result, rsp, rspErr := client.NFInstancesStoreApi.SearchNFInstances(ctx, targetNfType, requestNfType, &param)
result, rsp, rspErr := client.NFInstancesStoreApi.SearchNFInstances(ctx,
targetNfType, requestNfType, &param)

if rspErr != nil {
return nil, fmt.Errorf("NFInstancesStoreApi Response error: %+w", rspErr)
Expand Down
2 changes: 1 addition & 1 deletion internal/sbi/consumer/nf_management.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package consumer

import (
"context"

"fmt"
"net/http"
"strings"
Expand Down
2 changes: 1 addition & 1 deletion internal/sbi/producer/functions.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package producer

import (
"context"

"crypto/hmac"
"crypto/sha256"
"encoding/base64"
Expand Down
2 changes: 1 addition & 1 deletion internal/sbi/producer/ue_authentication.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package producer

import (
"bytes"
"context"

Check failure on line 5 in internal/sbi/producer/ue_authentication.go

View workflow job for this annotation

GitHub Actions / lint (1.18)

File is not `gofumpt`-ed (gofumpt)
"crypto/sha256"
"encoding/base64"
"encoding/hex"
Expand Down
28 changes: 14 additions & 14 deletions pkg/factory/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -153,8 +153,8 @@ func appendInvalid(err error) error {
}

func (c *Config) GetVersion() string {
c.RLock()
defer c.RUnlock()
c.RWMutex.RLock()
defer c.RWMutex.RUnlock()

if c.Info.Version != "" {
return c.Info.Version
Expand All @@ -163,8 +163,8 @@ func (c *Config) GetVersion() string {
}

func (c *Config) SetLogEnable(enable bool) {
c.Lock()
defer c.Unlock()
c.RWMutex.Lock()
defer c.RWMutex.Unlock()

if c.Logger == nil {
logger.CfgLog.Warnf("Logger should not be nil")
Expand All @@ -178,8 +178,8 @@ func (c *Config) SetLogEnable(enable bool) {
}

func (c *Config) SetLogLevel(level string) {
c.Lock()
defer c.Unlock()
c.RWMutex.Lock()
defer c.RWMutex.Unlock()

if c.Logger == nil {
logger.CfgLog.Warnf("Logger should not be nil")
Expand All @@ -192,8 +192,8 @@ func (c *Config) SetLogLevel(level string) {
}

func (c *Config) SetLogReportCaller(reportCaller bool) {
c.Lock()
defer c.Unlock()
c.RWMutex.Lock()
defer c.RWMutex.Unlock()

if c.Logger == nil {
logger.CfgLog.Warnf("Logger should not be nil")
Expand All @@ -207,8 +207,8 @@ func (c *Config) SetLogReportCaller(reportCaller bool) {
}

func (c *Config) GetLogEnable() bool {
c.RLock()
defer c.RUnlock()
c.RWMutex.RLock()
defer c.RWMutex.RUnlock()
if c.Logger == nil {
logger.CfgLog.Warnf("Logger should not be nil")
return false
Expand All @@ -217,8 +217,8 @@ func (c *Config) GetLogEnable() bool {
}

func (c *Config) GetLogLevel() string {
c.RLock()
defer c.RUnlock()
c.RWMutex.RLock()
defer c.RWMutex.RUnlock()
if c.Logger == nil {
logger.CfgLog.Warnf("Logger should not be nil")
return "info"
Expand All @@ -227,8 +227,8 @@ func (c *Config) GetLogLevel() string {
}

func (c *Config) GetLogReportCaller() bool {
c.RLock()
defer c.RUnlock()
c.RWMutex.RLock()
defer c.RWMutex.RUnlock()
if c.Logger == nil {
logger.CfgLog.Warnf("Logger should not be nil")
return false
Expand Down

0 comments on commit e9ba650

Please sign in to comment.