Skip to content

Commit

Permalink
Error Types: Fix missing function parameter (#81)
Browse files Browse the repository at this point in the history
This adds the missing parameter for the `open(..)` call.
  • Loading branch information
rafaveira3 authored and abhinav committed Jan 10, 2020
1 parent 1f4b461 commit d61205f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions style.md
Original file line number Diff line number Diff line change
Expand Up @@ -638,7 +638,7 @@ func open(file string) error {
}

func use() {
if err := open(); err != nil {
if err := open("testfile.txt"); err != nil {
if strings.Contains(err.Error(), "not found") {
// handle
} else {
Expand All @@ -664,7 +664,7 @@ func open(file string) error {
}

func use() {
if err := open(); err != nil {
if err := open("testfile.txt"); err != nil {
if _, ok := err.(errNotFound); ok {
// handle
} else {
Expand Down

0 comments on commit d61205f

Please sign in to comment.