Add script for checking thread locks in funcs that call MakeGitError #138
Loading…
Reference in New Issue
No description provided.
Delete Branch "check-MakeGitError-thread-lock"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This PR adds script/check-MakeGitError-thread-lock.go, which checks for funcs that call MakeGitError and that don't lock the OS thread. Its implementation is a simple
string.Contains
check on each*ast.FuncDecl
. It also adds this script tomake test
.These funcs should be fixed before this PR is merged.
The current output is:
Ref https://github.com/libgit2/git2go/issues/137
I've fixed the instanced pointed out by the script, but the script always errors out on go 1.1 because it seems to want to parse the C file.
I assume there's a way to work around that, but I'm not familiar with the parser package.
I updated the script to work with Go 1.1, and the Travis CI build now passes.