mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-10-29 02:52:26 -05:00
[chore] bump dependencies (#4406)
- codeberg.org/gruf/go-ffmpreg: v0.6.9 -> v0.6.10
- github.com/ncruces/go-sqlite3: v0.27.1 -> v0.28.0
- github.com/stretchr/testify: v1.10.0 -> v1.11.1
- github.com/tdewolff/minify/v2 v2.23.11 -> v2.24.2
- go.opentelemetry.io/otel{,/*}: v1.37.0 -> v1.38.0
- go.opentelemetry.io/contrib/*: v0.62.0 -> v0.63.0
Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4406
Co-authored-by: kim <grufwub@gmail.com>
Co-committed-by: kim <grufwub@gmail.com>
This commit is contained in:
parent
5a54e7156b
commit
78defcd916
274 changed files with 9213 additions and 2368 deletions
28
vendor/github.com/spf13/cobra/.golangci.yml
generated
vendored
28
vendor/github.com/spf13/cobra/.golangci.yml
generated
vendored
|
|
@ -12,14 +12,20 @@
|
|||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
version: "2"
|
||||
|
||||
run:
|
||||
deadline: 5m
|
||||
timeout: 5m
|
||||
|
||||
formatters:
|
||||
enable:
|
||||
- gofmt
|
||||
- goimports
|
||||
|
||||
linters:
|
||||
disable-all: true
|
||||
default: none
|
||||
enable:
|
||||
#- bodyclose
|
||||
# - deadcode ! deprecated since v1.49.0; replaced by 'unused'
|
||||
#- depguard
|
||||
#- dogsled
|
||||
#- dupl
|
||||
|
|
@ -30,28 +36,24 @@ linters:
|
|||
- goconst
|
||||
- gocritic
|
||||
#- gocyclo
|
||||
- gofmt
|
||||
- goimports
|
||||
#- gomnd
|
||||
#- goprintffuncname
|
||||
- gosec
|
||||
- gosimple
|
||||
- govet
|
||||
- ineffassign
|
||||
#- lll
|
||||
- misspell
|
||||
#- mnd
|
||||
#- nakedret
|
||||
#- noctx
|
||||
- nolintlint
|
||||
#- rowserrcheck
|
||||
#- scopelint
|
||||
- staticcheck
|
||||
#- structcheck ! deprecated since v1.49.0; replaced by 'unused'
|
||||
- stylecheck
|
||||
#- typecheck
|
||||
- unconvert
|
||||
#- unparam
|
||||
- unused
|
||||
# - varcheck ! deprecated since v1.49.0; replaced by 'unused'
|
||||
#- whitespace
|
||||
fast: false
|
||||
exclusions:
|
||||
presets:
|
||||
- common-false-positives
|
||||
- legacy
|
||||
- std-error-handling
|
||||
|
|
|
|||
24
vendor/github.com/spf13/cobra/README.md
generated
vendored
24
vendor/github.com/spf13/cobra/README.md
generated
vendored
|
|
@ -1,8 +1,14 @@
|
|||
|
||||

|
||||
<div align="center">
|
||||
<a href="https://cobra.dev">
|
||||
<img width="512" height="535" alt="cobra-logo" src="https://github.com/user-attachments/assets/c8bf9aad-b5ae-41d3-8899-d83baec10af8" />
|
||||
</a>
|
||||
</div>
|
||||
|
||||
Cobra is a library for creating powerful modern CLI applications.
|
||||
|
||||
<a href="https://cobra.dev">Visit Cobra.dev for extensive documentation</a>
|
||||
|
||||
|
||||
Cobra is used in many Go projects such as [Kubernetes](https://kubernetes.io/),
|
||||
[Hugo](https://gohugo.io), and [GitHub CLI](https://github.com/cli/cli) to
|
||||
name a few. [This list](site/content/projects_using_cobra.md) contains a more extensive list of projects using Cobra.
|
||||
|
|
@ -11,6 +17,20 @@ name a few. [This list](site/content/projects_using_cobra.md) contains a more ex
|
|||
[](https://pkg.go.dev/github.com/spf13/cobra)
|
||||
[](https://goreportcard.com/report/github.com/spf13/cobra)
|
||||
[](https://gophers.slack.com/archives/CD3LP1199)
|
||||
<hr>
|
||||
<div align="center" markdown="1">
|
||||
<sup>Supported by:</sup>
|
||||
<br>
|
||||
<br>
|
||||
<a href="https://www.warp.dev/cobra">
|
||||
<img alt="Warp sponsorship" width="400" src="https://github.com/user-attachments/assets/ab8dd143-b0fd-4904-bdc5-dd7ecac94eae">
|
||||
</a>
|
||||
|
||||
### [Warp, the AI terminal for devs](https://www.warp.dev/cobra)
|
||||
[Try Cobra in Warp today](https://www.warp.dev/cobra)<br>
|
||||
|
||||
</div>
|
||||
<hr>
|
||||
|
||||
# Overview
|
||||
|
||||
|
|
|
|||
105
vendor/github.com/spf13/cobra/SECURITY.md
generated
vendored
Normal file
105
vendor/github.com/spf13/cobra/SECURITY.md
generated
vendored
Normal file
|
|
@ -0,0 +1,105 @@
|
|||
# Security Policy
|
||||
|
||||
## Reporting a Vulnerability
|
||||
|
||||
The `cobra` maintainers take security issues seriously and
|
||||
we appreciate your efforts to _**responsibly**_ disclose your findings.
|
||||
We will make every effort to swiftly respond and address concerns.
|
||||
|
||||
To report a security vulnerability:
|
||||
|
||||
1. **DO NOT** create a public GitHub issue for the vulnerability!
|
||||
2. **DO NOT** create a public GitHub Pull Request with a fix for the vulnerability!
|
||||
3. Send an email to `cobra-security@googlegroups.com`.
|
||||
4. Include the following details in your report:
|
||||
- Description of the vulnerability
|
||||
- Steps to reproduce
|
||||
- Potential impact of the vulnerability (to your downstream project, to the Go ecosystem, etc.)
|
||||
- Any potential mitigations you've already identified
|
||||
5. Allow up to 7 days for an initial response.
|
||||
You should receive an acknowledgment of your report and an estimated timeline for a fix.
|
||||
6. (Optional) If you have a fix and would like to contribute your patch, please work
|
||||
directly with the maintainers via `cobra-security@googlegroups.com` to
|
||||
coordinate pushing the patch to GitHub, cutting a new release, and disclosing the change.
|
||||
|
||||
## Response Process
|
||||
|
||||
When a security vulnerability report is received, the `cobra` maintainers will:
|
||||
|
||||
1. Confirm receipt of the vulnerability report within 7 days.
|
||||
2. Assess the report to determine if it constitutes a security vulnerability.
|
||||
3. If confirmed, assign the vulnerability a severity level and create a timeline for addressing it.
|
||||
4. Develop and test a fix.
|
||||
5. Patch the vulnerability and make a new GitHub release: the maintainers will coordinate disclosure with the reporter.
|
||||
6. Create a new GitHub Security Advisory to inform the broader Go ecosystem
|
||||
|
||||
## Disclosure Policy
|
||||
|
||||
The `cobra` maintainers follow a coordinated disclosure process:
|
||||
|
||||
1. Security vulnerabilities will be addressed as quickly as possible.
|
||||
2. A CVE (Common Vulnerabilities and Exposures) identifier will be requested for significant vulnerabilities
|
||||
that are within `cobra` itself.
|
||||
3. Once a fix is ready, the maintainers will:
|
||||
- Release a new version containing the fix.
|
||||
- Update the security advisory with details about the vulnerability.
|
||||
- Credit the reporter (unless they wish to remain anonymous).
|
||||
- Credit the fixer (unless they wish to remain anonymous, this may be the same as the reporter).
|
||||
- Announce the vulnerability through appropriate channels
|
||||
(GitHub Security Advisory, mailing lists, GitHub Releases, etc.)
|
||||
|
||||
## Supported Versions
|
||||
|
||||
Security fixes will typically only be released for the most recent major release.
|
||||
|
||||
## Upstream Security Issues
|
||||
|
||||
`cobra` generally will not accept vulnerability reports that originate in upstream
|
||||
dependencies. I.e., if there is a problem in Go code that `cobra` depends on,
|
||||
it is best to engage that project's maintainers and owners.
|
||||
|
||||
This security policy primarily pertains only to `cobra` itself but if you believe you've
|
||||
identified a problem that originates in an upstream dependency and is being widely
|
||||
distributed by `cobra`, please follow the disclosure procedure above: the `cobra`
|
||||
maintainers will work with you to determine the severity and ecosystem impact.
|
||||
|
||||
## Security Updates and CVEs
|
||||
|
||||
Information about known security vulnerabilities and CVEs affecting `cobra` will
|
||||
be published as GitHub Security Advisories at
|
||||
https://github.com/spf13/cobra/security/advisories.
|
||||
|
||||
All users are encouraged to watch the repository and upgrade promptly when
|
||||
security releases are published.
|
||||
|
||||
## `cobra` Security Best Practices for Users
|
||||
|
||||
When using `cobra` in your CLIs, the `cobra` maintainers recommend the following:
|
||||
|
||||
1. Always use the latest version of `cobra`.
|
||||
2. [Use Go modules](https://go.dev/blog/using-go-modules) for dependency management.
|
||||
3. Always use the latest possible version of Go.
|
||||
|
||||
## Security Best Practices for Contributors
|
||||
|
||||
When contributing to `cobra`:
|
||||
|
||||
1. Be mindful of security implications when adding new features or modifying existing ones.
|
||||
2. Be aware of `cobra`'s extremely large reach: it is used in nearly every Go CLI
|
||||
(like Kubernetes, Docker, Prometheus, etc. etc.)
|
||||
3. Write tests that explicitly cover edge cases and potential issues.
|
||||
4. If you discover a security issue while working on `cobra`, please report it
|
||||
following the process above rather than opening a public pull request or issue that
|
||||
addresses the vulnerability.
|
||||
5. Take personal sec-ops seriously and secure your GitHub account: use [two-factor authentication](https://docs.github.com/en/authentication/securing-your-account-with-two-factor-authentication-2fa),
|
||||
[sign your commits with a GPG or SSH key](https://docs.github.com/en/authentication/managing-commit-signature-verification/about-commit-signature-verification),
|
||||
etc.
|
||||
|
||||
## Acknowledgments
|
||||
|
||||
The `cobra` maintainers would like to thank all security researchers and
|
||||
community members who help keep cobra, its users, and the entire Go ecosystem secure through responsible disclosures!!
|
||||
|
||||
---
|
||||
|
||||
*This security policy is inspired by the [Open Web Application Security Project (OWASP)](https://owasp.org/) guidelines and security best practices.*
|
||||
11
vendor/github.com/spf13/cobra/command.go
generated
vendored
11
vendor/github.com/spf13/cobra/command.go
generated
vendored
|
|
@ -39,7 +39,7 @@ const (
|
|||
)
|
||||
|
||||
// FParseErrWhitelist configures Flag parse errors to be ignored
|
||||
type FParseErrWhitelist flag.ParseErrorsWhitelist
|
||||
type FParseErrWhitelist flag.ParseErrorsAllowlist
|
||||
|
||||
// Group Structure to manage groups for commands
|
||||
type Group struct {
|
||||
|
|
@ -1296,6 +1296,11 @@ Simply type ` + c.DisplayName() + ` help [path to command] for full details.`,
|
|||
c.Printf("Unknown help topic %#q\n", args)
|
||||
CheckErr(c.Root().Usage())
|
||||
} else {
|
||||
// FLow the context down to be used in help text
|
||||
if cmd.ctx == nil {
|
||||
cmd.ctx = c.ctx
|
||||
}
|
||||
|
||||
cmd.InitDefaultHelpFlag() // make possible 'help' flag to be shown
|
||||
cmd.InitDefaultVersionFlag() // make possible 'version' flag to be shown
|
||||
CheckErr(cmd.Help())
|
||||
|
|
@ -1872,7 +1877,7 @@ func (c *Command) ParseFlags(args []string) error {
|
|||
c.mergePersistentFlags()
|
||||
|
||||
// do it here after merging all flags and just before parse
|
||||
c.Flags().ParseErrorsWhitelist = flag.ParseErrorsWhitelist(c.FParseErrWhitelist)
|
||||
c.Flags().ParseErrorsAllowlist = flag.ParseErrorsAllowlist(c.FParseErrWhitelist)
|
||||
|
||||
err := c.Flags().Parse(args)
|
||||
// Print warnings if they occurred (e.g. deprecated flag messages).
|
||||
|
|
@ -2020,7 +2025,7 @@ func defaultUsageFunc(w io.Writer, in interface{}) error {
|
|||
fmt.Fprint(w, trimRightSpace(c.InheritedFlags().FlagUsages()))
|
||||
}
|
||||
if c.HasHelpSubCommands() {
|
||||
fmt.Fprintf(w, "\n\nAdditional help topcis:")
|
||||
fmt.Fprintf(w, "\n\nAdditional help topics:")
|
||||
for _, subcmd := range c.Commands() {
|
||||
if subcmd.IsAdditionalHelpTopicCommand() {
|
||||
fmt.Fprintf(w, "\n %s %s", rpad(subcmd.CommandPath(), subcmd.CommandPathPadding()), subcmd.Short)
|
||||
|
|
|
|||
19
vendor/github.com/spf13/cobra/completions.go
generated
vendored
19
vendor/github.com/spf13/cobra/completions.go
generated
vendored
|
|
@ -115,6 +115,13 @@ type CompletionOptions struct {
|
|||
DisableDescriptions bool
|
||||
// HiddenDefaultCmd makes the default 'completion' command hidden
|
||||
HiddenDefaultCmd bool
|
||||
// DefaultShellCompDirective sets the ShellCompDirective that is returned
|
||||
// if no special directive can be determined
|
||||
DefaultShellCompDirective *ShellCompDirective
|
||||
}
|
||||
|
||||
func (receiver *CompletionOptions) SetDefaultShellCompDirective(directive ShellCompDirective) {
|
||||
receiver.DefaultShellCompDirective = &directive
|
||||
}
|
||||
|
||||
// Completion is a string that can be used for completions
|
||||
|
|
@ -375,7 +382,7 @@ func (c *Command) getCompletions(args []string) (*Command, []Completion, ShellCo
|
|||
// Error while attempting to parse flags
|
||||
if flagErr != nil {
|
||||
// If error type is flagCompError and we don't want flagCompletion we should ignore the error
|
||||
if _, ok := flagErr.(*flagCompError); !(ok && !flagCompletion) {
|
||||
if _, ok := flagErr.(*flagCompError); !ok || flagCompletion {
|
||||
return finalCmd, []Completion{}, ShellCompDirectiveDefault, flagErr
|
||||
}
|
||||
}
|
||||
|
|
@ -480,6 +487,14 @@ func (c *Command) getCompletions(args []string) (*Command, []Completion, ShellCo
|
|||
}
|
||||
} else {
|
||||
directive = ShellCompDirectiveDefault
|
||||
// check current and parent commands for a custom DefaultShellCompDirective
|
||||
for cmd := finalCmd; cmd != nil; cmd = cmd.parent {
|
||||
if cmd.CompletionOptions.DefaultShellCompDirective != nil {
|
||||
directive = *cmd.CompletionOptions.DefaultShellCompDirective
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
if flag == nil {
|
||||
foundLocalNonPersistentFlag := false
|
||||
// If TraverseChildren is true on the root command we don't check for
|
||||
|
|
@ -773,7 +788,7 @@ See each sub-command's help for details on how to use the generated script.
|
|||
// shell completion for it (prog __complete completion '')
|
||||
subCmd, cmdArgs, err := c.Find(args)
|
||||
if err != nil || subCmd.Name() != compCmdName &&
|
||||
!(subCmd.Name() == ShellCompRequestCmd && len(cmdArgs) > 1 && cmdArgs[0] == compCmdName) {
|
||||
(subCmd.Name() != ShellCompRequestCmd || len(cmdArgs) <= 1 || cmdArgs[0] != compCmdName) {
|
||||
// The completion command is not being called or being completed so we remove it.
|
||||
c.RemoveCommand(completionCmd)
|
||||
return
|
||||
|
|
|
|||
36
vendor/github.com/spf13/pflag/flag.go
generated
vendored
36
vendor/github.com/spf13/pflag/flag.go
generated
vendored
|
|
@ -137,12 +137,17 @@ const (
|
|||
PanicOnError
|
||||
)
|
||||
|
||||
// ParseErrorsWhitelist defines the parsing errors that can be ignored
|
||||
type ParseErrorsWhitelist struct {
|
||||
// ParseErrorsAllowlist defines the parsing errors that can be ignored
|
||||
type ParseErrorsAllowlist struct {
|
||||
// UnknownFlags will ignore unknown flags errors and continue parsing rest of the flags
|
||||
UnknownFlags bool
|
||||
}
|
||||
|
||||
// ParseErrorsWhitelist defines the parsing errors that can be ignored.
|
||||
//
|
||||
// Deprecated: use [ParseErrorsAllowlist] instead. This type will be removed in a future release.
|
||||
type ParseErrorsWhitelist = ParseErrorsAllowlist
|
||||
|
||||
// NormalizedName is a flag name that has been normalized according to rules
|
||||
// for the FlagSet (e.g. making '-' and '_' equivalent).
|
||||
type NormalizedName string
|
||||
|
|
@ -158,8 +163,13 @@ type FlagSet struct {
|
|||
// help/usage messages.
|
||||
SortFlags bool
|
||||
|
||||
// ParseErrorsWhitelist is used to configure a whitelist of errors
|
||||
ParseErrorsWhitelist ParseErrorsWhitelist
|
||||
// ParseErrorsAllowlist is used to configure an allowlist of errors
|
||||
ParseErrorsAllowlist ParseErrorsAllowlist
|
||||
|
||||
// ParseErrorsAllowlist is used to configure an allowlist of errors.
|
||||
//
|
||||
// Deprecated: use [FlagSet.ParseErrorsAllowlist] instead. This field will be removed in a future release.
|
||||
ParseErrorsWhitelist ParseErrorsAllowlist
|
||||
|
||||
name string
|
||||
parsed bool
|
||||
|
|
@ -928,7 +938,6 @@ func VarP(value Value, name, shorthand, usage string) {
|
|||
// returns the error.
|
||||
func (f *FlagSet) fail(err error) error {
|
||||
if f.errorHandling != ContinueOnError {
|
||||
fmt.Fprintln(f.Output(), err)
|
||||
f.usage()
|
||||
}
|
||||
return err
|
||||
|
|
@ -986,6 +995,8 @@ func (f *FlagSet) parseLongArg(s string, args []string, fn parseFunc) (a []strin
|
|||
f.usage()
|
||||
return a, ErrHelp
|
||||
case f.ParseErrorsWhitelist.UnknownFlags:
|
||||
fallthrough
|
||||
case f.ParseErrorsAllowlist.UnknownFlags:
|
||||
// --unknown=unknownval arg ...
|
||||
// we do not want to lose arg in this case
|
||||
if len(split) >= 2 {
|
||||
|
|
@ -1044,6 +1055,8 @@ func (f *FlagSet) parseSingleShortArg(shorthands string, args []string, fn parse
|
|||
err = ErrHelp
|
||||
return
|
||||
case f.ParseErrorsWhitelist.UnknownFlags:
|
||||
fallthrough
|
||||
case f.ParseErrorsAllowlist.UnknownFlags:
|
||||
// '-f=arg arg ...'
|
||||
// we do not want to lose arg in this case
|
||||
if len(shorthands) > 2 && shorthands[1] == '=' {
|
||||
|
|
@ -1158,12 +1171,12 @@ func (f *FlagSet) Parse(arguments []string) error {
|
|||
}
|
||||
f.parsed = true
|
||||
|
||||
f.args = make([]string, 0, len(arguments))
|
||||
|
||||
if len(arguments) == 0 {
|
||||
return nil
|
||||
}
|
||||
|
||||
f.args = make([]string, 0, len(arguments))
|
||||
|
||||
set := func(flag *Flag, value string) error {
|
||||
return f.Set(flag.Name, value)
|
||||
}
|
||||
|
|
@ -1174,7 +1187,10 @@ func (f *FlagSet) Parse(arguments []string) error {
|
|||
case ContinueOnError:
|
||||
return err
|
||||
case ExitOnError:
|
||||
fmt.Println(err)
|
||||
if err == ErrHelp {
|
||||
os.Exit(0)
|
||||
}
|
||||
fmt.Fprintln(f.Output(), err)
|
||||
os.Exit(2)
|
||||
case PanicOnError:
|
||||
panic(err)
|
||||
|
|
@ -1200,6 +1216,10 @@ func (f *FlagSet) ParseAll(arguments []string, fn func(flag *Flag, value string)
|
|||
case ContinueOnError:
|
||||
return err
|
||||
case ExitOnError:
|
||||
if err == ErrHelp {
|
||||
os.Exit(0)
|
||||
}
|
||||
fmt.Fprintln(f.Output(), err)
|
||||
os.Exit(2)
|
||||
case PanicOnError:
|
||||
panic(err)
|
||||
|
|
|
|||
34
vendor/github.com/spf13/pflag/golangflag.go
generated
vendored
34
vendor/github.com/spf13/pflag/golangflag.go
generated
vendored
|
|
@ -8,6 +8,7 @@ import (
|
|||
goflag "flag"
|
||||
"reflect"
|
||||
"strings"
|
||||
"time"
|
||||
)
|
||||
|
||||
// go test flags prefixes
|
||||
|
|
@ -113,6 +114,38 @@ func (f *FlagSet) AddGoFlagSet(newSet *goflag.FlagSet) {
|
|||
f.addedGoFlagSets = append(f.addedGoFlagSets, newSet)
|
||||
}
|
||||
|
||||
// CopyToGoFlagSet will add all current flags to the given Go flag set.
|
||||
// Deprecation remarks get copied into the usage description.
|
||||
// Whenever possible, a flag gets added for which Go flags shows
|
||||
// a proper type in the help message.
|
||||
func (f *FlagSet) CopyToGoFlagSet(newSet *goflag.FlagSet) {
|
||||
f.VisitAll(func(flag *Flag) {
|
||||
usage := flag.Usage
|
||||
if flag.Deprecated != "" {
|
||||
usage += " (DEPRECATED: " + flag.Deprecated + ")"
|
||||
}
|
||||
|
||||
switch value := flag.Value.(type) {
|
||||
case *stringValue:
|
||||
newSet.StringVar((*string)(value), flag.Name, flag.DefValue, usage)
|
||||
case *intValue:
|
||||
newSet.IntVar((*int)(value), flag.Name, *(*int)(value), usage)
|
||||
case *int64Value:
|
||||
newSet.Int64Var((*int64)(value), flag.Name, *(*int64)(value), usage)
|
||||
case *uintValue:
|
||||
newSet.UintVar((*uint)(value), flag.Name, *(*uint)(value), usage)
|
||||
case *uint64Value:
|
||||
newSet.Uint64Var((*uint64)(value), flag.Name, *(*uint64)(value), usage)
|
||||
case *durationValue:
|
||||
newSet.DurationVar((*time.Duration)(value), flag.Name, *(*time.Duration)(value), usage)
|
||||
case *float64Value:
|
||||
newSet.Float64Var((*float64)(value), flag.Name, *(*float64)(value), usage)
|
||||
default:
|
||||
newSet.Var(flag.Value, flag.Name, usage)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// ParseSkippedFlags explicitly Parses go test flags (i.e. the one starting with '-test.') with goflag.Parse(),
|
||||
// since by default those are skipped by pflag.Parse().
|
||||
// Typical usage example: `ParseGoTestFlags(os.Args[1:], goflag.CommandLine)`
|
||||
|
|
@ -125,3 +158,4 @@ func ParseSkippedFlags(osArgs []string, goFlagSet *goflag.FlagSet) error {
|
|||
}
|
||||
return goFlagSet.Parse(skippedFlags)
|
||||
}
|
||||
|
||||
|
|
|
|||
10
vendor/github.com/spf13/pflag/string_to_string.go
generated
vendored
10
vendor/github.com/spf13/pflag/string_to_string.go
generated
vendored
|
|
@ -4,6 +4,7 @@ import (
|
|||
"bytes"
|
||||
"encoding/csv"
|
||||
"fmt"
|
||||
"sort"
|
||||
"strings"
|
||||
)
|
||||
|
||||
|
|
@ -62,8 +63,15 @@ func (s *stringToStringValue) Type() string {
|
|||
}
|
||||
|
||||
func (s *stringToStringValue) String() string {
|
||||
keys := make([]string, 0, len(*s.value))
|
||||
for k := range *s.value {
|
||||
keys = append(keys, k)
|
||||
}
|
||||
sort.Strings(keys)
|
||||
|
||||
records := make([]string, 0, len(*s.value)>>1)
|
||||
for k, v := range *s.value {
|
||||
for _, k := range keys {
|
||||
v := (*s.value)[k]
|
||||
records = append(records, k+"="+v)
|
||||
}
|
||||
|
||||
|
|
|
|||
8
vendor/github.com/spf13/pflag/time.go
generated
vendored
8
vendor/github.com/spf13/pflag/time.go
generated
vendored
|
|
@ -48,7 +48,13 @@ func (d *timeValue) Type() string {
|
|||
return "time"
|
||||
}
|
||||
|
||||
func (d *timeValue) String() string { return d.Time.Format(time.RFC3339Nano) }
|
||||
func (d *timeValue) String() string {
|
||||
if d.Time.IsZero() {
|
||||
return ""
|
||||
} else {
|
||||
return d.Time.Format(time.RFC3339Nano)
|
||||
}
|
||||
}
|
||||
|
||||
// GetTime return the time value of a flag with the given name
|
||||
func (f *FlagSet) GetTime(name string) (time.Time, error) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue