1
0
mirror of https://github.com/DNSCrypt/dnscrypt-proxy.git synced 2024-12-28 00:20:13 +01:00
dnscrypt-proxy/vendor/github.com/powerman/check/flags.go
2021-07-03 10:56:53 +02:00

26 lines
358 B
Go

package check
import (
"flag"
"sync"
)
type peekFlags struct {
sync.Once
conveyJSON bool
}
//nolint:gochecknoglobals // By design.
var flags peekFlags
func (p *peekFlags) detect() *peekFlags {
flags.Do(func() {
flag.Visit(func(f *flag.Flag) {
if f.Name == "convey-json" {
p.conveyJSON = f.Value.String() == "true"
}
})
})
return p
}