Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
perxis-go
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Package registry
Operate
Terraform modules
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
perxis
perxis-go
Commits
248bb0b8
Commit
248bb0b8
authored
1 year ago
by
ensiouel
Browse files
Options
Downloads
Patches
Plain Diff
Revert "в функцию Set добавлена проверка data на nil"
This reverts commit
5da33b0b
.
parent
5da33b0b
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
pkg/data/data.go
+0
-6
0 additions, 6 deletions
pkg/data/data.go
pkg/data/data_test.go
+0
-6
0 additions, 6 deletions
pkg/data/data_test.go
with
0 additions
and
12 deletions
pkg/data/data.go
+
0
−
6
View file @
248bb0b8
...
...
@@ -9,8 +9,6 @@ import (
const
DefaultFieldDelimiter
=
"."
var
ErrDataIsNil
=
errors
.
New
(
"data is nil"
)
type
DeleteValueType
struct
{}
var
DeleteValue
DeleteValueType
...
...
@@ -171,10 +169,6 @@ func getPath(field string, delim ...string) []string {
}
func
Set
(
field
string
,
data
,
value
any
,
delim
...
string
)
error
{
if
data
==
nil
{
return
ErrDataIsNil
}
return
set
(
getPath
(
field
,
delim
...
),
data
,
value
)
}
...
...
This diff is collapsed.
Click to expand it.
pkg/data/data_test.go
+
0
−
6
View file @
248bb0b8
...
...
@@ -316,12 +316,6 @@ func TestSet(t *testing.T) {
[]
any
{(
map
[
string
]
any
)(
nil
),
map
[
string
]
any
{
"b"
:
"2"
}},
assert
.
Error
,
},
{
"Set object to nil data"
,
args
{
"a"
,
nil
,
"1"
},
nil
,
assert
.
Error
,
},
}
for
_
,
tt
:=
range
tests
{
t
.
Run
(
tt
.
name
,
func
(
t
*
testing
.
T
)
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment