Skip to content

Commit

Permalink
Fix skipped file closing
Browse files Browse the repository at this point in the history
Signed-off-by: Ashish Tiwari <ashishjaitiwari15112000@gmail.com>
  • Loading branch information
Revolyssup committed Jul 2, 2022
1 parent 2f78661 commit b5e2a44
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions adapter/oam.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,14 +104,13 @@ func (or *OAMRegistrant) Register() error {
if err != nil {
return ErrOpenOAMDefintionFile(err)
}
defer func() {
_ = definition.Close()
}()

definitionMap := map[string]interface{}{}
if err := json.NewDecoder(definition).Decode(&definitionMap); err != nil {
_ = definition.Close()
return ErrJSONMarshal(err)
}
_ = definition.Close()
ord.OAMDefinition = definitionMap

schema, err := ioutil.ReadFile(dpath.OAMRefSchemaPath)
Expand Down

0 comments on commit b5e2a44

Please sign in to comment.