Last active
November 11, 2015 19:36
-
-
Save aj0strow/b71888d73a4444f56396 to your computer and use it in GitHub Desktop.
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
// node lock-catcher.js myprogram.go | |
var reader = require('line-reader') | |
var file = process.argv[2] | |
var prev = null | |
reader.eachLine(file, function (line) { | |
if (prev && /Lock/.test(prev) && !/defer/.test(line)) { | |
console.error('You probably messed up.') | |
} | |
prev = line | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment