This repository has been archived by the owner on Jan 31, 2023. It is now read-only.
forked from mwitkow/go-flagz
-
Notifications
You must be signed in to change notification settings - Fork 1
Add support for go modules. #1
Open
crufter
wants to merge
7
commits into
master
Choose a base branch
from
go-modules
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
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
- create go.sum - do not use .. in filenames in this repo due to golang/go#27299 Testing strategy: I almost successfully ran `test_all.sh` and found a data race, but I don't think it's related to this PR: ``` WARNING: DATA RACE Read at 0x00c00016cac0 by goroutine 29: github.com/spf13/pflag.(*FlagSet).VisitAll() /home/stefan/usr/go/main/pkg/mod/github.com/spf13/pflag@v1.0.3/flag.go:277 +0x14a github.com/mwitkow/go-flagz.ChecksumFlagSet() /home/stefan/Projects/go-flagz/checksum.go:15 +0xc8 github.com/mwitkow/go-flagz/monitoring.(*flagSetCollector).Collect() /home/stefan/Projects/go-flagz/monitoring/collector.go:57 +0x2a2 github.com/prometheus/client_golang/prometheus.(*Registry).Gather.func1() /home/stefan/usr/go/main/pkg/mod/github.com/prometheus/client_golang@v0.9.2/prometheus/registry.go:434 +0x1eb Previous write at 0x00c00016cac0 by goroutine 28: github.com/spf13/pflag.sortFlags() /home/stefan/usr/go/main/pkg/mod/github.com/spf13/pflag@v1.0.3/flag.go:204 +0x2f2 github.com/spf13/pflag.(*FlagSet).VisitAll() /home/stefan/usr/go/main/pkg/mod/github.com/spf13/pflag@v1.0.3/flag.go:270 +0x1b0 github.com/mwitkow/go-flagz.ChecksumFlagSet() /home/stefan/Projects/go-flagz/checksum.go:15 +0xc8 github.com/mwitkow/go-flagz/monitoring.(*flagSetCollector).Collect() /home/stefan/Projects/go-flagz/monitoring/collector.go:55 +0xe9 github.com/prometheus/client_golang/prometheus.(*Registry).Gather.func1() /home/stefan/usr/go/main/pkg/mod/github.com/prometheus/client_golang@v0.9.2/prometheus/registry.go:434 +0x1eb ```
Closed
Edit: not relevant anymore. |
crufter
commented
Oct 18, 2019
// ChecksumFlagSet will generate a FNV of the *set* values in a FlagSet. | ||
func ChecksumFlagSet(flagSet *pflag.FlagSet, flagFilter func(flag *pflag.Flag) bool) []byte { | ||
h := fnv.New32a() | ||
|
||
visitAllMutex.Lock() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Admitteldy this feels heavy handed and not elegant considering the package mostly uses atomic instead of locking, but the reads and writes happening in VisitAll
triggered the race detector.
crufter
changed the title
[WIP] Add support for go modules.
Add support for go modules.
Oct 18, 2019
is this going in / still being worked on / maintained? |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR does 4 things:
mwitkow/go-flagz
->improbable-eng/go-flagz
) because it is a recently forked library.