Code Review
/
ric-plt
/
nodeb-rnib.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Upgrade version to 1.0.21
[ric-plt/nodeb-rnib.git]
/
common
/
utils.go
diff --git
a/common/utils.go
b/common/utils.go
index
7b7b4e2
..
baf5d23
100644
(file)
--- a/
common/utils.go
+++ b/
common/utils.go
@@
-17,17
+17,15
@@
package common
import (
package common
import (
- "errors"
"fmt"
)
/*
ValidateAndBuildCellIdKey builds key according to the specified format returns the resulting string
*/
"fmt"
)
/*
ValidateAndBuildCellIdKey builds key according to the specified format returns the resulting string
*/
-func ValidateAndBuildCellIdKey(cellId string) (string,
IRNibE
rror) {
+func ValidateAndBuildCellIdKey(cellId string) (string,
e
rror) {
if cellId == "" {
if cellId == "" {
- e := errors.New("#utils.ValidateAndBuildCellIdKey - an empty cell id received")
- return "", NewValidationError(e)
+ return "", NewValidationError("#utils.ValidateAndBuildCellIdKey - an empty cell id received")
}
return fmt.Sprintf("CELL:%s", cellId), nil
}
}
return fmt.Sprintf("CELL:%s", cellId), nil
}
@@
-35,10
+33,9
@@
func ValidateAndBuildCellIdKey(cellId string) (string, IRNibError) {
/*
ValidateAndBuildNrCellIdKey builds key according to the specified format returns the resulting string
*/
/*
ValidateAndBuildNrCellIdKey builds key according to the specified format returns the resulting string
*/
-func ValidateAndBuildNrCellIdKey(cellId string) (string,
IRNibE
rror) {
+func ValidateAndBuildNrCellIdKey(cellId string) (string,
e
rror) {
if cellId == "" {
if cellId == "" {
- e := errors.New("#utils.ValidateAndBuildNrCellIdKey - an empty cell id received")
- return "", NewValidationError(e)
+ return "", NewValidationError("#utils.ValidateAndBuildNrCellIdKey - an empty cell id received")
}
return fmt.Sprintf("NRCELL:%s", cellId), nil
}
}
return fmt.Sprintf("NRCELL:%s", cellId), nil
}
@@
-46,10
+43,9
@@
func ValidateAndBuildNrCellIdKey(cellId string) (string, IRNibError) {
/*
ValidateAndBuildNodeBNameKey builds key according to the specified format returns the resulting string
*/
/*
ValidateAndBuildNodeBNameKey builds key according to the specified format returns the resulting string
*/
-func ValidateAndBuildNodeBNameKey(inventoryName string) (string,
IRNibE
rror) {
+func ValidateAndBuildNodeBNameKey(inventoryName string) (string,
e
rror) {
if inventoryName == "" {
if inventoryName == "" {
- e := errors.New("#utils.ValidateAndBuildNodeBNameKey - an empty inventory name received")
- return "", NewValidationError(e)
+ return "", NewValidationError("#utils.ValidateAndBuildNodeBNameKey - an empty inventory name received")
}
return fmt.Sprintf("RAN:%s", inventoryName), nil
}
}
return fmt.Sprintf("RAN:%s", inventoryName), nil
}
@@
-57,18
+53,15
@@
func ValidateAndBuildNodeBNameKey(inventoryName string) (string, IRNibError) {
/*
ValidateAndBuildNodeBIdKey builds key according to the specified format returns the resulting string
*/
/*
ValidateAndBuildNodeBIdKey builds key according to the specified format returns the resulting string
*/
-func ValidateAndBuildNodeBIdKey(nodeType string, plmnId string, nbId string) (string,
IRNibE
rror) {
+func ValidateAndBuildNodeBIdKey(nodeType string, plmnId string, nbId string) (string,
e
rror) {
if nodeType == "" {
if nodeType == "" {
- e := errors.New("#utils.ValidateAndBuildNodeBIdKey - an empty node type received")
- return "", NewValidationError(e)
+ return "", NewValidationError("#utils.ValidateAndBuildNodeBIdKey - an empty node type received")
}
if plmnId == "" {
}
if plmnId == "" {
- e := errors.New("#utils.ValidateAndBuildNodeBIdKey - an empty plmnId received")
- return "", NewValidationError(e)
+ return "", NewValidationError("#utils.ValidateAndBuildNodeBIdKey - an empty plmnId received")
}
if nbId == "" {
}
if nbId == "" {
- e := errors.New("#utils.ValidateAndBuildNodeBIdKey - an empty nbId received")
- return "", NewValidationError(e)
+ return "", NewValidationError("#utils.ValidateAndBuildNodeBIdKey - an empty nbId received")
}
return fmt.Sprintf("%s:%s:%s", nodeType, plmnId, nbId), nil
}
}
return fmt.Sprintf("%s:%s:%s", nodeType, plmnId, nbId), nil
}
@@
-76,19
+69,17
@@
func ValidateAndBuildNodeBIdKey(nodeType string, plmnId string, nbId string) (st
/*
ValidateAndBuildCellNamePciKey builds key according to the specified format returns the resulting string
*/
/*
ValidateAndBuildCellNamePciKey builds key according to the specified format returns the resulting string
*/
-func ValidateAndBuildCellNamePciKey(inventoryName string, pci uint32) (string,
IRNibE
rror) {
+func ValidateAndBuildCellNamePciKey(inventoryName string, pci uint32) (string,
e
rror) {
if inventoryName == "" {
if inventoryName == "" {
- e := errors.New("#utils.ValidateAndBuildCellNamePciKey - an empty inventory name received")
- return "", NewValidationError(e)
+ return "", NewValidationError("#utils.ValidateAndBuildCellNamePciKey - an empty inventory name received")
}
return fmt.Sprintf("PCI:%s:%02x", inventoryName, pci), nil
}
}
return fmt.Sprintf("PCI:%s:%02x", inventoryName, pci), nil
}
-func ValidateAndBuildRanLoadInformationKey(inventoryName string) (string,
IRNibE
rror) {
+func ValidateAndBuildRanLoadInformationKey(inventoryName string) (string,
e
rror) {
if inventoryName == "" {
if inventoryName == "" {
- e := errors.New("#utils.ValidateAndBuildRanLoadInformationKey - an empty inventory name received")
- return "", NewValidationError(e)
+ return "", NewValidationError("#utils.ValidateAndBuildRanLoadInformationKey - an empty inventory name received")
}
return fmt.Sprintf("LOAD:%s", inventoryName), nil
}
return fmt.Sprintf("LOAD:%s", inventoryName), nil