Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
adam.huang
go-libp2p
Commits
1c6efef4
Commit
1c6efef4
authored
Nov 23, 2015
by
Jeromy
Browse files
vendor in go-detect-race
parent
23ce2328
Changes
11
Hide whitespace changes
Inline
Side-by-side
.gitignore
View file @
1c6efef4
*.swp
*.swp
vendor
p2p/net/mock/mock_test.go
View file @
1c6efef4
...
@@ -14,7 +14,7 @@ import (
...
@@ -14,7 +14,7 @@ import (
protocol
"github.com/ipfs/go-libp2p/p2p/protocol"
protocol
"github.com/ipfs/go-libp2p/p2p/protocol"
testutil
"github.com/ipfs/go-libp2p/testutil"
testutil
"github.com/ipfs/go-libp2p/testutil"
detectrace
"g
ithub.com/jbenet
/go-detect-race"
detectrace
"g
x/QmQHGMVmrsgmqUG8ih3puNXUJneSpi13dkcZpzLKkskUkH
/go-detect-race"
context
"gx/QmacZi9WygGK7Me8mH53pypyscHzU386aUZXpr28GZgUct/context"
context
"gx/QmacZi9WygGK7Me8mH53pypyscHzU386aUZXpr28GZgUct/context"
)
)
...
...
package.json
View file @
1c6efef4
...
@@ -77,6 +77,11 @@
...
@@ -77,6 +77,11 @@
"name"
:
"go-metrics"
,
"name"
:
"go-metrics"
,
"hash"
:
"QmeYJHEk8UjVVZ4XCRTZe6dFQrb8pGWD81LYCgeLp8CvMB"
,
"hash"
:
"QmeYJHEk8UjVVZ4XCRTZe6dFQrb8pGWD81LYCgeLp8CvMB"
,
"version"
:
"0.0.0"
"version"
:
"0.0.0"
},
{
"name"
:
"go-detect-race"
,
"hash"
:
"QmQHGMVmrsgmqUG8ih3puNXUJneSpi13dkcZpzLKkskUkH"
,
"version"
:
"0.0.0"
}
}
],
],
"language"
:
"go"
,
"language"
:
"go"
,
...
...
vendor/gx/QmQHGMVmrsgmqUG8ih3puNXUJneSpi13dkcZpzLKkskUkH/go-detect-race/.gxignore
0 → 100644
View file @
1c6efef4
Godeps/*
\ No newline at end of file
vendor/gx/QmQHGMVmrsgmqUG8ih3puNXUJneSpi13dkcZpzLKkskUkH/go-detect-race/LICENSE
0 → 100644
View file @
1c6efef4
The MIT License (MIT)
Copyright (c) 2014 Juan Batiz-Benet
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
vendor/gx/QmQHGMVmrsgmqUG8ih3puNXUJneSpi13dkcZpzLKkskUkH/go-detect-race/README.md
0 → 100644
View file @
1c6efef4
# go-detect-race
Check if the race detector is running.
I didnt find a variable to check quickly enough so I made this.
## Usage
```
go
import
(
detectrace
"github.com/jbenet/go-detect-race"
)
func
main
()
{
if
detectrace
.
WithRace
()
{
// running with -race
}
else
{
// running without -race
}
}
```
## Why?
Because the race detector doesnt like massive stress tests. Example:
https://groups.google.com/forum/#!topic/golang-nuts/XDPHUt2LE70
## Why didn't you just use...
Please tell me about a better way of doing this. It wasn't
readily apparent to me, so I made this. But i would much prefer
an env var or some already existing var from the stdlib :)
vendor/gx/QmQHGMVmrsgmqUG8ih3puNXUJneSpi13dkcZpzLKkskUkH/go-detect-race/package.json
0 → 100644
View file @
1c6efef4
{
"name"
:
"go-detect-race"
,
"author"
:
"whyrusleeping"
,
"version"
:
"0.0.0"
,
"language"
:
"go"
,
"issues_url"
:
""
,
"gx"
:
{
"dvcsimport"
:
"github.com/jbenet/go-detect-race"
}
}
\ No newline at end of file
vendor/gx/QmQHGMVmrsgmqUG8ih3puNXUJneSpi13dkcZpzLKkskUkH/go-detect-race/race.go
0 → 100644
View file @
1c6efef4
package
detectrace
// WithRace returns whether the binary was compiled
// with the race flag on.
func
WithRace
()
bool
{
return
withRace
}
vendor/gx/QmQHGMVmrsgmqUG8ih3puNXUJneSpi13dkcZpzLKkskUkH/go-detect-race/race_test.go
0 → 100644
View file @
1c6efef4
package
detectrace
import
(
"testing"
)
func
TestWithRace
(
t
*
testing
.
T
)
{
t
.
Logf
(
"WithRace() is %v
\n
"
,
WithRace
())
}
vendor/gx/QmQHGMVmrsgmqUG8ih3puNXUJneSpi13dkcZpzLKkskUkH/go-detect-race/withoutrace.go
0 → 100644
View file @
1c6efef4
// +build !race
package
detectrace
const
withRace
=
false
vendor/gx/QmQHGMVmrsgmqUG8ih3puNXUJneSpi13dkcZpzLKkskUkH/go-detect-race/withrace.go
0 → 100644
View file @
1c6efef4
// +build race
package
detectrace
const
withRace
=
true
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment