Skip to content

Commit

Permalink
Merge pull request #9 from kiwiz/main
Browse files Browse the repository at this point in the history
Export readBytes as FromBytes
  • Loading branch information
owenrumney authored Mar 3, 2021
2 parents 537965e + 6d32931 commit 80b8c53
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions sarif/sarif.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,15 @@ func Open(filename string) (*Report, error) {
if err != nil {
return nil, fmt.Errorf("the provided filepath could not be opened. %w", err)
}
return readBytes(content)
return FromBytes(content)
}


func FromString(content string) (*Report, error) {
return readBytes([]byte(content))
return FromBytes([]byte(content))
}

func readBytes(content []byte) (*Report, error) {
func FromBytes(content []byte) (*Report, error) {
var report Report
if err := json.Unmarshal(content, &report); err != nil{
return nil, err
Expand Down

0 comments on commit 80b8c53

Please sign in to comment.