Skip to content

Commit

Permalink
fix linter error
Browse files Browse the repository at this point in the history
  • Loading branch information
mfdeveloper508 committed Sep 27, 2023
1 parent 018dbad commit 0485485
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion field/binary.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ func (f *Binary) SetData(data interface{}) error {
func (f *Binary) Unmarshal(v interface{}) error {
switch val := v.(type) {
case reflect.Value:
switch val.Kind() {
switch val.Kind() { //nolint:exhaustive
case reflect.String:
if !val.CanSet() {
return fmt.Errorf("reflect.Value of the data can not be change")
Expand Down
2 changes: 1 addition & 1 deletion field/composite.go
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ func (f *Composite) Unmarshal(v interface{}) error {
}

dataField := dataStruct.Field(i)
switch dataField.Kind() {
switch dataField.Kind() { //nolint:exhaustive
case reflect.Chan, reflect.Func, reflect.Map, reflect.Pointer, reflect.UnsafePointer, reflect.Interface, reflect.Slice:
if dataField.IsNil() {
dataField.Set(reflect.New(dataField.Type().Elem()))
Expand Down
2 changes: 1 addition & 1 deletion field/hex.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ func (f *Hex) SetData(data interface{}) error {
func (f *Hex) Unmarshal(v interface{}) error {
switch val := v.(type) {
case reflect.Value:
switch val.Kind() {
switch val.Kind() { //nolint:exhaustive
case reflect.String:
if !val.CanSet() {
return fmt.Errorf("reflect.Value of the data can not be change")
Expand Down
2 changes: 1 addition & 1 deletion field/numeric.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ func (f *Numeric) SetData(data interface{}) error {
func (f *Numeric) Unmarshal(v interface{}) error {
switch val := v.(type) {
case reflect.Value:
switch val.Kind() {
switch val.Kind() { //nolint:exhaustive
case reflect.String:
if !val.CanSet() {
return fmt.Errorf("reflect.Value of the data can not be change")
Expand Down
2 changes: 1 addition & 1 deletion field/string.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ func (f *String) SetData(data interface{}) error {
func (f *String) Unmarshal(v interface{}) error {
switch val := v.(type) {
case reflect.Value:
switch val.Kind() {
switch val.Kind() { //nolint:exhaustive
case reflect.String:
if !val.CanSet() {
return fmt.Errorf("reflect.Value of the data can not be change")
Expand Down
2 changes: 1 addition & 1 deletion message.go
Original file line number Diff line number Diff line change
Expand Up @@ -502,7 +502,7 @@ func (m *Message) Unmarshal(v interface{}) error {
}

dataField := dataStruct.Field(i)
switch dataField.Kind() {
switch dataField.Kind() { //nolint:exhaustive
case reflect.Chan, reflect.Func, reflect.Map, reflect.Pointer, reflect.UnsafePointer, reflect.Interface, reflect.Slice:
if dataField.IsNil() {
dataField.Set(reflect.New(dataField.Type().Elem()))
Expand Down

0 comments on commit 0485485

Please sign in to comment.