Skip to content

Commit

Permalink
Fix golangci-lint error
Browse files Browse the repository at this point in the history
  • Loading branch information
free5gc-org committed Aug 2, 2021
1 parent e67bca0 commit fb08751
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 10 deletions.
3 changes: 2 additions & 1 deletion ngapConvert/AmfId.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
package ngapConvert

import (
"encoding/hex"

"github.com/free5gc/aper"
"github.com/free5gc/ngap/logger"
"encoding/hex"
)

func AmfIdToNgap(amfId string) (regionId, setId, ptrId aper.BitString) {
Expand Down
3 changes: 2 additions & 1 deletion ngapConvert/BitString.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
package ngapConvert

import (
"encoding/hex"

"github.com/free5gc/aper"
"github.com/free5gc/ngap/logger"
"encoding/hex"
)

func BitStringToHex(bitString *aper.BitString) (hexString string) {
Expand Down
6 changes: 4 additions & 2 deletions ngapConvert/PlmnId.go
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
package ngapConvert

import (
"encoding/hex"
"strings"

"github.com/free5gc/ngap/logger"
"github.com/free5gc/ngap/ngapType"
"github.com/free5gc/openapi/models"
"encoding/hex"
"strings"
)

func PlmnIdToModels(ngapPlmnId ngapType.PLMNIdentity) (modelsPlmnid models.PlmnId) {
Expand All @@ -19,6 +20,7 @@ func PlmnIdToModels(ngapPlmnId ngapType.PLMNIdentity) (modelsPlmnid models.PlmnI
}
return
}

func PlmnIdToNgap(modelsPlmnid models.PlmnId) ngapType.PLMNIdentity {
var hexString string
mcc := strings.Split(modelsPlmnid.Mcc, "")
Expand Down
3 changes: 2 additions & 1 deletion ngapConvert/PortNumber.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
package ngapConvert

import (
"github.com/free5gc/ngap/ngapType"
"encoding/binary"

"github.com/free5gc/ngap/ngapType"
)

func PortNumberToInt(port ngapType.PortNumber) (portInt32 int32) {
Expand Down
4 changes: 2 additions & 2 deletions ngapConvert/TimeStamp.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
package ngapConvert

import (
"encoding/binary"

"github.com/free5gc/aper"
"github.com/free5gc/ngap/logger"
"encoding/binary"
)

/*
Expand Down Expand Up @@ -36,7 +37,6 @@ RFC 5905 Section 6 https://tools.ietf.org/html/rfc5905#section-6
*/
func TimeStampToInt32(timeStampNgap aper.OctetString) (timeStamp int32) {

if len(timeStampNgap) != 4 {
logger.NgapLog.Error("TimeStampToInt32: the size of OctetString is not 4")
}
Expand Down
7 changes: 4 additions & 3 deletions ngapConvert/TraceData.go
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
package ngapConvert

import (
"encoding/hex"
"strings"

"github.com/free5gc/aper"
"github.com/free5gc/ngap/logger"
"github.com/free5gc/ngap/ngapType"
"github.com/free5gc/openapi/models"
"encoding/hex"
"strings"
)

func TraceDataToModels(traceActivation ngapType.TraceActivation) (traceData models.TraceData) {
Expand All @@ -22,7 +23,7 @@ func TraceDataToNgap(traceData models.TraceData, trsr string) ngapType.TraceActi
return traceActivation
}

//NG-RAN Trace ID (left most 6 octet Trace Reference + last 2 octet Trace Recoding Session Reference)
// NG-RAN Trace ID (left most 6 octet Trace Reference + last 2 octet Trace Recoding Session Reference)
subStringSlice := strings.Split(traceData.TraceRef, "-")

if len(subStringSlice) != 2 {
Expand Down

0 comments on commit fb08751

Please sign in to comment.