...
 
Commits (12)
    https://gitlab.dms3.io/dms3/go-detect-race/-/commit/a7feafca2fe27bc5f3ed25417a41d0e6c7882a3d v1 2015-03-01T18:21:10-08:00 Juan Batiz-Benet juan@benet.ai https://gitlab.dms3.io/dms3/go-detect-race/-/commit/3463798d9574bd0b7eca275dccc530804ff5216f readme update 2015-03-01T18:24:21-08:00 Juan Batiz-Benet juan@benet.ai https://gitlab.dms3.io/dms3/go-detect-race/-/commit/98b1e8eab643ccfb7dea131c9fcd8b204f456915 Publish to gx 2016-11-23T15:29:32+01:00 Jakub Sztandera kubuxu@protonmail.ch https://gitlab.dms3.io/dms3/go-detect-race/-/commit/4b36b7c8361c98a391a3ed1a6238ee85e8c06fea Update dvcsimport 2018-02-12T12:31:17+01:00 Hector Sanjuan code@hector.link https://gitlab.dms3.io/dms3/go-detect-race/-/commit/5ea9f55c8a669394da8ff8f23e217366098bf5b6 gx publish 1.0.1 2018-02-12T12:31:32+01:00 Hector Sanjuan code@hector.link https://gitlab.dms3.io/dms3/go-detect-race/-/commit/52daa73989bc95b2fa97d6c610adf62d04eb7822 Add go mod and travis 2019-02-28T18:34:18+01:00 Jakub Sztandera kubuxu@protonmail.ch https://gitlab.dms3.io/dms3/go-detect-race/-/commit/3219ea83e1458c3468d49f4245819b5a96621611 doc: add a lead maintainer 2019-09-18T22:15:32-07:00 Steven Allen steven@stebalien.com https://gitlab.dms3.io/dms3/go-detect-race/-/commit/23a11bc3c738097927f70a7e939efc33b2688471 Add standard issue template 2020-04-27T11:34:21+02:00 Hector Sanjuan code@hector.link https://gitlab.dms3.io/dms3/go-detect-race/-/commit/8ae28497170d3ac41eae9f51c032b9f9554fd483 Add autocomment configuration 2020-05-04T12:12:21+02:00 Hector Sanjuan code@hector.link https://gitlab.dms3.io/dms3/go-detect-race/-/commit/6cbc987096f53e0c40e8f5358308d6591f2b2182 Merge remote-tracking branch 'upstream/master' into reference 2021-05-24T06:02:03-04:00 tavit ohanian tavit@dms3.io https://gitlab.dms3.io/dms3/go-detect-race/-/commit/dc2b89bef2772fd9ff91f952a0f40bbed3908917 initial port 2021-05-24T06:05:35-04:00 tavit ohanian tavit@dms3.io https://gitlab.dms3.io/dms3/go-detect-race/-/commit/a88f13445cbf1fe3f985d8b0ad30f892a463c3c9 Merge branch 'port-2021-05-24' into 'master' 2021-05-24T10:09:58+00:00 tavit ohanian tavit@dms3.io Port 2021 05 24 See merge request dms3/public/go-detect-race!1
blank_issues_enabled: false
contact_links:
- name: Getting Help on IPFS
url: https://ipfs.io/help
about: All information about how and where to get help on IPFS.
- name: IPFS Official Forum
url: https://discuss.ipfs.io
about: Please post general questions, support requests, and discussions here.
---
name: Open an issue
about: Only for actionable issues relevant to this repository.
title: ''
labels: need/triage
assignees: ''
---
<!--
Hello! To ensure this issue is correctly addressed as soon as possible by the IPFS team, please try to make sure:
- This issue is relevant to this repository's topic or codebase.
- A clear description is provided. It should includes as much relevant information as possible and clear scope for the issue to be actionable.
FOR GENERAL DISCUSSION, HELP OR QUESTIONS, please see the options at https://ipfs.io/help or head directly to https://discuss.ipfs.io.
(you can delete this section after reading)
-->
# Configuration for welcome - https://github.com/behaviorbot/welcome
# Configuration for new-issue-welcome - https://github.com/behaviorbot/new-issue-welcome
# Comment to be posted to on first time issues
newIssueWelcomeComment: >
Thank you for submitting your first issue to this repository! A maintainer
will be here shortly to triage and review.
In the meantime, please double-check that you have provided all the
necessary information to make this process easy! Any information that can
help save additional round trips is useful! We currently aim to give
initial feedback within **two business days**. If this does not happen, feel
free to leave a comment.
Please keep an eye on how this issue will be labeled, as labels give an
overview of priorities, assignments and additional actions requested by the
maintainers:
- "Priority" labels will show how urgent this is for the team.
- "Status" labels will show if this is ready to be worked on, blocked, or in progress.
- "Need" labels will indicate if additional input or analysis is required.
Finally, remember to use https://discuss.ipfs.io if you just need general
support.
# Configuration for new-pr-welcome - https://github.com/behaviorbot/new-pr-welcome
# Comment to be posted to on PRs from first time contributors in your repository
newPRWelcomeComment: >
Thank you for submitting this PR!
A maintainer will be here shortly to review it.
We are super grateful, but we are also overloaded! Help us by making sure
that:
* The context for this PR is clear, with relevant discussion, decisions
and stakeholders linked/mentioned.
* Your contribution itself is clear (code comments, self-review for the
rest) and in its best form. Follow the [code contribution
guidelines](https://github.com/ipfs/community/blob/master/CONTRIBUTING.md#code-contribution-guidelines)
if they apply.
Getting other community members to do a review would be great help too on
complex PRs (you can ask in the chats/forums). If you are unsure about
something, just leave us a comment.
Next steps:
* A maintainer will triage and assign priority to this PR, commenting on
any missing things and potentially assigning a reviewer for high
priority items.
* The PR gets reviews, discussed and approvals as needed.
* The PR is merged by maintainers when it has been approved and comments addressed.
We currently aim to provide initial feedback/triaging within **two business
days**. Please keep an eye on any labelling actions, as these will indicate
priorities and status of your contribution.
We are very grateful for your contribution!
# Configuration for first-pr-merge - https://github.com/behaviorbot/first-pr-merge
# Comment to be posted to on pull requests merged by a first time user
# Currently disabled
#firstPRMergeComment: ""
stages:
- build
- test
variables:
BUILD_DIR: "/tmp/$CI_CONCURRENT_PROJECT_ID"
before_script:
- mkdir -p $BUILD_DIR/src
- cd $BUILD_DIR/src
- if [ -d $CI_PROJECT_DIR ]
- then
- echo "soft link $CI_PROJECT_DIR exists"
- else
- echo "creating soft link $CI_PROJECT_DIR"
- ln -s $CI_PROJECT_DIR
- fi
- cd $CI_PROJECT_DIR
build:
stage: build
tags:
- testing
script:
- echo $CI_JOB_STAGE
- go build
test:
stage: test
tags:
- testing
script:
- echo $CI_JOB_STAGE
- go test -cover
coverage: '/coverage: \d+.\d+% of statements/'
1.0.1: Qmf7HqcW7LtCi1W8y2bdx2eJpze74jkbKqpByxgXikdbLF
os:
- linux
language: go
go:
- 1.11.x
env:
global:
- GOTFLAGS="-race"
matrix:
- BUILD_DEPTYPE=gx
- BUILD_DEPTYPE=gomod
# disable travis install
install:
- true
script:
- bash <(curl -s https://raw.githubusercontent.com/ipfs/ci-helpers/master/travis-ci/run-standard-tests.sh)
cache:
directories:
- $GOPATH/src/gx
- $GOPATH/pkg/mod
- $HOME/.cache/go-build
notifications:
email: false
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.
# go-detect-race
Check if the race detector is running.
I didnt find a variable to check quickly enough so I made this.
## Lead Maintainer
[Steven Allen](https://github.com/Stebalien)
## 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 :)
{
"author": "jbenet",
"bugs": {
"url": "https://github.com/ipfs/go-detect-race"
},
"gx": {
"dvcsimport": "github.com/ipfs/go-detect-race"
},
"gxVersion": "0.10.0",
"language": "go",
"license": "MIT",
"name": "go-detect-race",
"releaseCmd": "git commit -a -m \"gx publish $VERSION\"",
"version": "1.0.1"
}
package detectrace
// WithRace returns whether the binary was compiled
// with the race flag on.
func WithRace() bool {
return withRace
}
package detectrace
import (
"testing"
)
func TestWithRace(t *testing.T) {
t.Logf("WithRace() is %v\n", WithRace())
}
// +build !race
package detectrace
const withRace = false
// +build race
package detectrace
const withRace = true