-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add config option to extend
ignoreSigs
(#56)
The use case for this is I would like to add another signature to ignore, but still being able to rely on the default list is convenient, since I don't have to manually sync my list with any future changes to the defaults. closes #54
- Loading branch information
1 parent
4a8f079
commit e8cc4d2
Showing
4 changed files
with
47 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
extraIgnoreSigs: | ||
- json.Marshal( | ||
|
||
ignoreSigs: | ||
- errors.New( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package main | ||
|
||
import ( | ||
"encoding/json" | ||
"errors" | ||
) | ||
|
||
func main() { | ||
do() | ||
} | ||
|
||
func do() error { | ||
// no issue with function in 'extraIgnoreSigs' | ||
_, err := json.Marshal(struct{}{}) | ||
if err != nil { | ||
return err | ||
} | ||
|
||
// expect issue for function that is not ignored | ||
res := struct{}{} | ||
if err := json.Unmarshal([]byte("{}"), &res); err != nil { | ||
return err // want `error returned from external package is unwrapped` | ||
} | ||
|
||
// no issue with function in 'ignoreSigs' | ||
return errors.New("Some error") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters