From f6a884d8fce515c40acac747458a4430aa93fa9b Mon Sep 17 00:00:00 2001 From: Patricia Reinoso Date: Fri, 12 Jan 2024 17:50:48 +0100 Subject: [PATCH 1/3] enable fieldalignment go vet check Signed-off-by: Patricia Reinoso --- .golangci.yml | 2 -- context/context.go | 10 +++++----- factory/config.go | 2 +- factory/factory.go | 2 +- 4 files changed, 7 insertions(+), 9 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index a8d3406..5c2e1f5 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -171,8 +171,6 @@ linters-settings: - (github.com/golangci/golangci-lint/pkg/logutils.Log).Fatalf # enable all analyzers enable-all: true - disable: - - fieldalignment depguard: list-type: blacklist include-go-root: false diff --git a/context/context.go b/context/context.go index 6b1156c..ff51196 100644 --- a/context/context.go +++ b/context/context.go @@ -36,19 +36,19 @@ type UDRContext struct { Name string UriScheme models.UriScheme BindingIPv4 string - SBIPort int RegisterIPv4 string // IP register to NRF HttpIPv6Address string NfId string NrfUri string + SubscriptionDataSubscriptions map[subsId]*models.SubscriptionDataSubscriptions + PolicyDataSubscriptions map[subsId]*models.PolicyDataSubscription + UESubsCollection sync.Map // map[ueId]*UESubsData + UEGroupCollection sync.Map // map[ueGroupId]*UEGroupSubsData + SBIPort int EeSubscriptionIDGenerator int SdmSubscriptionIDGenerator int PolicyDataSubscriptionIDGenerator int - UESubsCollection sync.Map // map[ueId]*UESubsData - UEGroupCollection sync.Map // map[ueGroupId]*UEGroupSubsData SubscriptionDataSubscriptionIDGenerator int - SubscriptionDataSubscriptions map[subsId]*models.SubscriptionDataSubscriptions - PolicyDataSubscriptions map[subsId]*models.PolicyDataSubscription appDataInfluDataSubscriptionIdGenerator uint64 mtx sync.RWMutex } diff --git a/factory/config.go b/factory/config.go index d3735a3..eb7694d 100644 --- a/factory/config.go +++ b/factory/config.go @@ -51,12 +51,12 @@ type PlmnSupportItem 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"` BindingIPv4 string `yaml:"bindingIPv4,omitempty"` // IP used to run the server in the node. Port int `yaml:"port"` - Tls *Tls `yaml:"tls,omitempty"` } type Tls struct { diff --git a/factory/factory.go b/factory/factory.go index 500b2ac..19505f0 100644 --- a/factory/factory.go +++ b/factory/factory.go @@ -29,9 +29,9 @@ type UpdateDb struct { } type SmPolicyUpdateEntry struct { + Snssai *protos.NSSAI Imsi string Dnn string - Snssai *protos.NSSAI } var initLog *logrus.Entry From 5e18b86d5165be8f27432c6f26e5f66553c1da03 Mon Sep 17 00:00:00 2001 From: Patricia Reinoso Date: Thu, 25 Jan 2024 11:06:23 +0100 Subject: [PATCH 2/3] Update factory/config.go Co-authored-by: gab-arrobo --- factory/config.go | 1 - 1 file changed, 1 deletion(-) diff --git a/factory/config.go b/factory/config.go index eb7694d..c67ee2c 100644 --- a/factory/config.go +++ b/factory/config.go @@ -54,7 +54,6 @@ 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"` BindingIPv4 string `yaml:"bindingIPv4,omitempty"` // IP used to run the server in the node. Port int `yaml:"port"` } From a3dfd7d70beae377c3cb5755086ef2f93b96c003 Mon Sep 17 00:00:00 2001 From: Patricia Reinoso Date: Thu, 25 Jan 2024 11:14:45 +0100 Subject: [PATCH 3/3] Reorder structs and fix format Signed-off-by: Patricia Reinoso --- context/context.go | 2 +- factory/config.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/context/context.go b/context/context.go index ff51196..c97ed48 100644 --- a/context/context.go +++ b/context/context.go @@ -44,13 +44,13 @@ type UDRContext struct { PolicyDataSubscriptions map[subsId]*models.PolicyDataSubscription UESubsCollection sync.Map // map[ueId]*UESubsData UEGroupCollection sync.Map // map[ueGroupId]*UEGroupSubsData + mtx sync.RWMutex SBIPort int EeSubscriptionIDGenerator int SdmSubscriptionIDGenerator int PolicyDataSubscriptionIDGenerator int SubscriptionDataSubscriptionIDGenerator int appDataInfluDataSubscriptionIdGenerator uint64 - mtx sync.RWMutex } type UESubsData struct { diff --git a/factory/config.go b/factory/config.go index c67ee2c..bf1b7bc 100644 --- a/factory/config.go +++ b/factory/config.go @@ -54,8 +54,8 @@ type Sbi struct { Tls *Tls `yaml:"tls,omitempty"` Scheme string `yaml:"scheme"` RegisterIPv4 string `yaml:"registerIPv4,omitempty"` // IP that is registered at NRF. - BindingIPv4 string `yaml:"bindingIPv4,omitempty"` // IP used to run the server in the node. - Port int `yaml:"port"` + BindingIPv4 string `yaml:"bindingIPv4,omitempty"` // IP used to run the server in the node. + Port int `yaml:"port"` } type Tls struct {