Skip to content

Commit

Permalink
✅ fix by review
Browse files Browse the repository at this point in the history
Signed-off-by: vankichi <[email protected]>
  • Loading branch information
vankichi committed Jan 27, 2021
1 parent 2fc0a42 commit 00df149
Showing 1 changed file with 7 additions and 77 deletions.
84 changes: 7 additions & 77 deletions internal/errors/option_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,17 +94,7 @@ func TestNewErrInvalidOption(t *testing.T) {
nil,
New("set option failed."),
}
var e error
for _, err := range errs {
if err == nil {
continue
}
if e != nil {
e = Wrap(err, e.Error())
} else {
e = err
}
}
e := errs[1]
return test{
name: "return ErrInvalidOpton when all of parameter has value and errs has nil as value.",
args: args{
Expand All @@ -126,17 +116,7 @@ func TestNewErrInvalidOption(t *testing.T) {
New("set option failed."),
New("name is nil."),
}
var e error
for _, err := range errs {
if err == nil {
continue
}
if e != nil {
e = Wrap(err, e.Error())
} else {
e = err
}
}
e := Wrap(errs[1], errs[0].Error())
return test{
name: "return ErrInvalidOpton when name is nil and val and errs have values.",
args: args{
Expand All @@ -157,17 +137,7 @@ func TestNewErrInvalidOption(t *testing.T) {
New("set option failed."),
New("val is nil."),
}
var e error
for _, err := range errs {
if err == nil {
continue
}
if e != nil {
e = Wrap(err, e.Error())
} else {
e = err
}
}
e := Wrap(errs[1], errs[0].Error())
return test{
name: "return ErrInvalidOpton when val is nil and name and errs have values.",
args: args{
Expand Down Expand Up @@ -396,17 +366,7 @@ func TestNewErrCriticalOption(t *testing.T) {
errs := []error{
New("set option failed"),
}
var e error
for _, err := range errs {
if err == nil {
continue
}
if e != nil {
e = Wrap(err, e.Error())
} else {
e = err
}
}
e := errs[0]
return test{
name: "return ErrCriticalOption when all of parameter has value.",
args: args{
Expand All @@ -429,17 +389,7 @@ func TestNewErrCriticalOption(t *testing.T) {
nil,
New("set option failed."),
}
var e error
for _, err := range errs {
if err == nil {
continue
}
if e != nil {
e = Wrap(err, e.Error())
} else {
e = err
}
}
e := errs[1]
return test{
name: "return ErrCriticalOption when all of parameter has value and errs has nil as value.",
args: args{
Expand All @@ -461,17 +411,7 @@ func TestNewErrCriticalOption(t *testing.T) {
New("set option failed."),
New("name is nil."),
}
var e error
for _, err := range errs {
if err == nil {
continue
}
if e != nil {
e = Wrap(err, e.Error())
} else {
e = err
}
}
e := Wrap(errs[1], errs[0].Error())
return test{
name: "return ErrCriticalOption when name is nil and val and errs have values.",
args: args{
Expand All @@ -492,17 +432,7 @@ func TestNewErrCriticalOption(t *testing.T) {
New("set option failed."),
New("val is nil."),
}
var e error
for _, err := range errs {
if err == nil {
continue
}
if e != nil {
e = Wrap(err, e.Error())
} else {
e = err
}
}
e := Wrap(errs[1], errs[0].Error())
return test{
name: "return ErrCriticalOption when val is nil and name and errs have values.",
args: args{
Expand Down

0 comments on commit 00df149

Please sign in to comment.