Naming, layout and comments: descriptive full-word names, one item per line in wrapped calls and literals, and doc comments on exported names
Short and single-letter names in application code become full words (tests keep theirs). Wrapped calls, signatures and composite literals put one item per line, and one-line function bodies are expanded. Exported names and groups of constants get doc comments, and comments refer to the renamed identifiers.
This commit is contained in:
1 parent
043e307663
commit
465358609a
78 files changed
+2374
-1402
No files matched your search
+10
-10
@@ -29,23 +29,23 @@ var stageTags = map[string][]string{
|
||||
|
||||
// filter keeps the opportunities whose latest release is at stage. Releases
|
||||
// are oldest first, so the last one is the procedure's current stage.
|
||||
func filter(opps []*types.Opportunity, stage string) []*types.Opportunity {
|
||||
var resp []*types.Opportunity
|
||||
func filter(opportunities []*types.Opportunity, stage string) []*types.Opportunity {
|
||||
var matching []*types.Opportunity
|
||||
|
||||
for _, opp := range opps {
|
||||
if len(opp.Releases) == 0 {
|
||||
for _, opportunity := range opportunities {
|
||||
if len(opportunity.Releases) == 0 {
|
||||
continue
|
||||
}
|
||||
latest := opp.Releases[len(opp.Releases)-1]
|
||||
latest := opportunity.Releases[len(opportunity.Releases)-1]
|
||||
for _, tag := range latest.Tags {
|
||||
if slices.Contains(stageTags[stage], tag.Tag) {
|
||||
resp = append(resp, opp)
|
||||
matching = append(matching, opportunity)
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return resp
|
||||
return matching
|
||||
}
|
||||
|
||||
func commandOnce(opts *cli.Options) *cobra.Command {
|
||||
@@ -71,12 +71,12 @@ func commandOnce(opts *cli.Options) *cobra.Command {
|
||||
return sinceErr
|
||||
}
|
||||
|
||||
ft := findatender.New(conf, conf.Sources.FindATender.APIRoot)
|
||||
defer ft.Shutdown()
|
||||
findATender := findatender.New(conf, conf.Sources.FindATender.APIRoot)
|
||||
defer findATender.Shutdown()
|
||||
|
||||
ignoreRateLimit, _ := cmd.Flags().GetBool("ignore-rate-limit")
|
||||
|
||||
results, err := ft.FetchAll(since, !ignoreRateLimit)
|
||||
results, err := findATender.FetchAll(since, !ignoreRateLimit)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user