Skip to content

Commit 2f04a80

Browse files
authored
Fix issue with golang dependencies due to semver format in module (#81)
Signed-off-by: Arrobo, Gabriel <gabriel.arrobo@intel.com>
1 parent 0606d79 commit 2f04a80

File tree

7 files changed

+52
-40
lines changed

7 files changed

+52
-40
lines changed

.golangci.yml

+39-27
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# SPDX-FileCopyrightText: 2024 Intel Corporation
22
# Copyright 2019 free5GC.org
3+
#
34
# SPDX-License-Identifier: Apache-2.0
5+
#
46

57
# This file contains all available configuration options
68
# with their default values.
@@ -25,7 +27,6 @@ run:
2527
skip-dirs:
2628
# default is true. Enables skipping of directories:
2729
# vendor$, third_party$, testdata$, examples$, Godeps$, builtin$
28-
skip-dirs-use-default: true
2930
# by default isn't set. If set we pass it to "go list -mod={option}". From "go help modules":
3031
# If invoked with -mod=readonly, the go command is disallowed from the implicit
3132
# automatic updating of go.mod described above. Instead, it fails when any changes
@@ -46,8 +47,6 @@ output:
4647
print-issued-lines: true
4748
# print linter name in the end of issue text, default is true
4849
print-linter-name: true
49-
# make issues output unique by line, default is true
50-
uniq-by-line: true
5150
# all available settings of specific linters
5251
linters-settings:
5352
errcheck:
@@ -119,7 +118,7 @@ linters-settings:
119118
goimports:
120119
# put imports beginning with prefix after 3rd-party packages;
121120
# it's a comma-separated list of prefixes
122-
local-prefixes: github.com/org/project
121+
local-prefixes: github.com/omec-project
123122
golint:
124123
# minimal confidence for issues, default is 0.8
125124
min-confidence: 0.8
@@ -157,13 +156,10 @@ linters-settings:
157156
- (github.com/golangci/golangci-lint/pkg/logutils.Log).Warnf
158157
- (github.com/golangci/golangci-lint/pkg/logutils.Log).Errorf
159158
- (github.com/golangci/golangci-lint/pkg/logutils.Log).Fatalf
160-
# enable or disable analyzers by name
161-
enable:
162-
- atomicalign
163-
- fieldalignment
164-
enable-all: false
159+
# enable all analyzers
160+
enable-all: true
165161
disable:
166-
- shadow
162+
# - fieldalignment
167163
disable-all: false
168164
depguard:
169165
list-type: blacklist
@@ -200,36 +196,59 @@ linters-settings:
200196
misspell:
201197
#locale: US
202198
ignore-words:
199+
wsl:
200+
# If true append is only allowed to be cuddled if appending value is
201+
# matching variables, fields or types on line above. Default is true.
202+
strict-append: true
203+
# Allow calls and assignments to be cuddled as long as the lines have any
204+
# matching variables, fields or types. Default is true.
205+
allow-assign-and-call: true
206+
# Allow multiline assignments to be cuddled. Default is true.
207+
allow-multiline-assign: true
208+
# Allow declarations (var) to be cuddled.
209+
allow-cuddle-declarations: false
210+
# Allow trailing comments in ending of blocks
211+
allow-trailing-comment: true
212+
# Force newlines in end of case at this limit (0 = never).
213+
force-case-trailing-whitespace: 0
214+
# Force cuddling of err checks with err var assignment
215+
force-err-cuddling: false
216+
# Allow leading comments to be separated with empty liens
217+
allow-separated-leading-comment: false
203218
custom:
204219
# Each custom linter should have a unique name.
205220

206221
linters:
207222
enable:
208223
- gofmt
209-
- govet
210-
- errcheck
211-
- staticcheck
224+
# - govet
225+
# - errcheck
212226
- unused
213227
- gosimple
214228
- ineffassign
215229
- typecheck
216230
# Additional
217-
- lll
231+
# - lll
218232
- godox
219233
# - mnd
220-
- nestif
221234
- goconst
222-
- gocognit
235+
# - gocognit
236+
# - nestif
237+
# - gomodguard
223238
- nakedret
224239
- gci
225240
- misspell
226241
- gofumpt
227-
- whitespace
242+
# - whitespace
228243
- unconvert
229-
- predeclared
244+
# - predeclared
230245
- noctx
231246
- dogsled
247+
# - bodyclose
232248
- asciicheck
249+
# - stylecheck
250+
# - unparam
251+
# - wsl
233252

234253
#disable-all: false
235254
fast: true
@@ -240,21 +259,13 @@ issues:
240259
# excluded by default patterns execute `golangci-lint run --help`
241260
exclude:
242261
# Excluding configuration per-path, per-linter, per-text and per-source
243-
exclude-files:
244-
- nas.go
245-
- nas_test.go
246-
exclude-dirs:
247-
- nasConvert
248-
- nasMessage
249-
- nasType
250-
- nasTestpacket
251262
exclude-rules:
252263
# Exclude some linters from running on tests files.
253264
# Independently from option `exclude` we use default exclude patterns,
254265
# it can be disabled by this option. To list all
255266
# excluded by default patterns execute `golangci-lint run --help`.
256267
# Default value for this option is true.
257-
exclude-use-default: false
268+
exclude-use-default: true
258269
# The default value is false. If set to true exclude and exclude-rules
259270
# regular expressions become case sensitive.
260271
exclude-case-sensitive: false
@@ -276,6 +287,7 @@ issues:
276287
new-from-rev: ""
277288
# Show only new issues created in git patch with set file path.
278289
#new-from-patch: path/to/patch/file
290+
uniq-by-line: true
279291
severity:
280292
# Default value is empty string.
281293
# Set the default severity for issues. If severity rules are defined and the issues

VERSION

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.4.5-dev
1+
1.4.5

go.mod

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
module github.com/omec-project/nas
22

3-
go 1.23
3+
go 1.23.0
44

55
require (
66
github.com/aead/cmac v0.0.0-20160719120800-7af84192f0b1
7-
github.com/omec-project/openapi v1.3.3
8-
github.com/omec-project/util v1.2.13
7+
github.com/omec-project/openapi v1.3.4
8+
github.com/omec-project/util v1.2.14
99
github.com/smartystreets/goconvey v1.8.1
1010
github.com/stretchr/testify v1.10.0
1111
go.uber.org/zap v1.27.0

go.sum

+4-4
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
1616
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
1717
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
1818
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
19-
github.com/omec-project/openapi v1.3.3 h1:7eKUx/pJk/+YXWW/KMi6HINMZp/OXtkucwg5nY72hiQ=
20-
github.com/omec-project/openapi v1.3.3/go.mod h1:3yzI+RxQIqSiOYav4Si7aKxG0MyoWRxY1kPyLwdWzJo=
21-
github.com/omec-project/util v1.2.13 h1:aeeeqRTlVITrtNnlrKuzhn4dMJP9uaE73cpYtGiAqfM=
22-
github.com/omec-project/util v1.2.13/go.mod h1:9Om0eXG8HyQ2wQD6Z9IWarFtcVSLQgAG6uZPQlmGADc=
19+
github.com/omec-project/openapi v1.3.4 h1:euU/mjfb5uc8jxq6JBvq3qu+XxGVI8VyYceElth2wEg=
20+
github.com/omec-project/openapi v1.3.4/go.mod h1:EmAF+wtNYi6he9mgAySf2B/YHlzOiHZJ1CNG6Kaa8lM=
21+
github.com/omec-project/util v1.2.14 h1:0dXNn5TjPhxABqNoAYtP4nOkchMV5o5fAJ/Giq3IviU=
22+
github.com/omec-project/util v1.2.14/go.mod h1:cqutFsv2QNDyB0P4m1/R46oVeCIqXq871f0umEN16VE=
2323
github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA=
2424
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
2525
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=

nasConvert/AmfId.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ func AmfIdToNas(amfId string) (amfRegionId uint8, amfSetId uint16, amfPointer ui
1717
logger.ConvertLog.Errorf("amfId decode failed: %+v", err)
1818
}
1919

20-
amfRegionId = uint8(amfIdBytes[0])
20+
amfRegionId = amfIdBytes[0]
2121
amfSetId = uint16(amfIdBytes[1])<<2 + (uint16(amfIdBytes[2])&0x00c0)>>6
22-
amfPointer = uint8(amfIdBytes[2]) & 0x3f
22+
amfPointer = amfIdBytes[2] & 0x3f
2323
return
2424
}
2525

nasConvert/NetWorkName.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ func FullNetworkNameToNas(name string) (fullNetworkName nasType.FullNameForNetwo
2020
if i == 0 {
2121
buf = append(buf, char)
2222
} else {
23-
buf[i-1] = (buf[i-1] & nasType.GetBitMask(idx+1, 0)) + uint8(char<<idx)
23+
buf[i-1] = (buf[i-1] & nasType.GetBitMask(idx+1, 0)) + char<<idx
2424
buf = append(buf, char>>(8-idx))
2525
idx--
2626
// if idx overflow, it will round to max(uint8) == 255 == ^uint8(0)
@@ -49,7 +49,7 @@ func ShortNetworkNameToNas(name string) (shortNetworkName nasType.ShortNameForNe
4949
if i == 0 {
5050
buf = append(buf, char)
5151
} else {
52-
buf[i-1] = (buf[i-1] & nasType.GetBitMask(idx+1, 0)) + uint8(char<<idx)
52+
buf[i-1] = (buf[i-1] & nasType.GetBitMask(idx+1, 0)) + char<<idx
5353
buf = append(buf, char>>(8-idx))
5454
idx--
5555
// if idx overflow, it will round to max(uint8) == 255 == ^uint8(0)

nasConvert/Snssai.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import (
1515

1616
func SnssaiToModels(nasSnssai *nasType.SNSSAI) (snssai models.Snssai) {
1717
sD := nasSnssai.GetSD()
18-
snssai.Sd = hex.EncodeToString([]uint8(sD[:]))
18+
snssai.Sd = hex.EncodeToString(sD[:])
1919
snssai.Sst = int32(nasSnssai.GetSST())
2020
return
2121
}

0 commit comments

Comments
 (0)