Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Adds go vet analyzers in CI #67

Merged
merged 6 commits into from
Jan 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 2 additions & 7 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -169,13 +169,8 @@ linters-settings:
- (github.com/golangci/golangci-lint/pkg/logutils.Log).Warnf
- (github.com/golangci/golangci-lint/pkg/logutils.Log).Errorf
- (github.com/golangci/golangci-lint/pkg/logutils.Log).Fatalf
# enable or disable analyzers by name
enable:
- atomicalign
enable-all: false
disable:
- shadow
disable-all: false
# enable all analyzers
enable-all: true
depguard:
list-type: blacklist
include-go-root: false
Expand Down
6 changes: 3 additions & 3 deletions context/context.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ type UDMContext struct {
Name string
NfId string
GroupId string
SBIPort int
RegisterIPv4 string // IP register to NRF
BindingIPv4 string
UriScheme models.UriScheme
Expand All @@ -53,6 +52,7 @@ type UDMContext struct {
Keys *factory.Keys
EeSubscriptionIDGenerator *idgenerator.IDGenerator
PlmnList []factory.PlmnSupportItem
SBIPort int
}

type UdmUeContext struct {
Expand All @@ -65,7 +65,6 @@ type UdmUeContext struct {
AccessAndMobilitySubscriptionData *models.AccessAndMobilitySubscriptionData
SmfSelSubsData *models.SmfSelectionSubscriptionData
UeCtxtInSmfData *models.UeContextInSmfData
TraceDataResponse models.TraceDataResponse
TraceData *models.TraceData
SessionManagementSubsData map[string]models.SessionManagementSubscriptionData
SubsDataSets *models.SubscriptionDataSets
Expand All @@ -75,6 +74,7 @@ type UdmUeContext struct {
UdrUri string
UdmSubsToNotify map[string]*models.SubscriptionDataSubscriptions
EeSubscriptions map[string]*models.EeSubscription // subscriptionID as key
TraceDataResponse models.TraceDataResponse
amSubsDataLock sync.Mutex
smfSelSubsDataLock sync.Mutex
SmSubsDataLock sync.RWMutex
Expand All @@ -87,9 +87,9 @@ func (ue *UdmUeContext) init() {
}

type UdmNFContext struct {
SubscriptionID string
SubscribeToNotifChange *models.SdmSubscription // SubscriptionID as key
SubscribeToNotifSharedDataChange *models.SdmSubscription // SubscriptionID as key
SubscriptionID string
}

func (context *UDMContext) GetUdmProfileAHNPublicKey() string {
Expand Down
2 changes: 1 addition & 1 deletion factory/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,12 @@ type Configuration struct {
}

type Sbi struct {
Tls *Tls `yaml:"tls,omitempty"`
Scheme string `yaml:"scheme"`
RegisterIPv4 string `yaml:"registerIPv4,omitempty"` // IP that is registered at NRF.
// IPv6Addr string `yaml:"ipv6Addr,omitempty"`
gab-arrobo marked this conversation as resolved.
Show resolved Hide resolved
BindingIPv4 string `yaml:"bindingIPv4,omitempty"` // IP used to run the server in the node.
Port int `yaml:"port,omitempty"`
Tls *Tls `yaml:"tls,omitempty"`
}

type Tls struct {
Expand Down
18 changes: 6 additions & 12 deletions httpcallback/router.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ package httpcallback

import (
"net/http"
"strings"

"github.com/gin-gonic/gin"
"github.com/omec-project/logger_util"
Expand All @@ -23,14 +22,14 @@ func init() {

// Route is the information for every URI.
type Route struct {
// HandlerFunc is the handler function of this route.
HandlerFunc gin.HandlerFunc
// Name is the name of this Route.
Name string
// Method is the string for the HTTP method. ex) GET, POST etc..
Method string
// Pattern is the pattern of the URI.
Pattern string
// HandlerFunc is the handler function of this route.
HandlerFunc gin.HandlerFunc
}

// Routes is the list of the generated Route.
Expand Down Expand Up @@ -70,16 +69,11 @@ func Index(c *gin.Context) {

var routes = Routes{
{
"Index",
"GET",
"/",
Index,
Name: "Index", Method: "GET",
Pattern: "/", HandlerFunc: Index,
},

{
"DataChangeNotificationToNF",
strings.ToUpper("Post"),
"/sdm-subscriptions",
HTTPDataChangeNotificationToNF,
Name: "DataChangeNotificationToNF", Method: "POST",
Pattern: "/sdm-subscriptions", HandlerFunc: HTTPDataChangeNotificationToNF,
},
}
4 changes: 2 additions & 2 deletions producer/generate_auth_data.go
Original file line number Diff line number Diff line change
Expand Up @@ -388,10 +388,10 @@ func GenerateAuthDataProcedure(authInfoRequest models.AuthenticationInfoRequest,
problemDetails = &models.ProblemDetails{
Status: http.StatusForbidden,
Cause: authenticationRejected,
Detail: deCodeErr.Error(),
Detail: err.Error(),
}

logger.UeauLog.Errorln("err", deCodeErr)
logger.UeauLog.Errorln("err", err)
return nil, problemDetails
}

Expand Down
Loading