Skip to content

Commit 95372d3

Browse files
chore(sdk): Fixes future linter error (#1904)
### Proposed Changes - Validates a cast is `ok` in a test function for a known value - Newer versions of golangci-lint will fail on this line with `errcheck` ### Checklist - [ ] I have added or updated unit tests - [ ] I have added or updated integration tests (if appropriate) - [ ] I have added or updated documentation ### Testing Instructions
1 parent 84339d6 commit 95372d3

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

sdk/tdf_test.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1145,7 +1145,11 @@ func (s *TDFSuite) Test_ValidateSchema() {
11451145
return err
11461146
}
11471147

1148-
(data["payload"].(map[string]interface{}))["tdf_spec_version"] = nil //nolint:forcetypeassert // testonly code
1148+
if m, ok := data["payload"].(map[string]interface{}); ok {
1149+
m["tdf_spec_version"] = nil
1150+
} else {
1151+
s.Fail("payload type invalid")
1152+
}
11491153

11501154
err = json.NewEncoder(dst).Encode(data)
11511155
return err

0 commit comments

Comments
 (0)