package tick import ( "testing" "time" "os" ) func TestLock(t *testing.T) { file, err := os.Create("pid.lock") if err != nil { t.Error(err) return } err = LockFile(file) if err != nil { t.Error(err) return } time.Sleep(time.Second * 100) }