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:
bwilliams committed 2026-10-15 16:12:56 +01:00
1 parent 043e307663
commit 465358609a
78 files changed
+2374 -1402

No files matched your search

+10 -10
View File
@@ -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
}
+3 -1
View File
@@ -12,7 +12,9 @@ import (
// opp makes an opportunity whose releases, oldest first, have these tags.
func opp(uuid string, tags ...string) *types.Opportunity {
o := &types.Opportunity{UUID: uuid}
o := &types.Opportunity{
UUID: uuid,
}
for _, tag := range tags {
o.Releases = append(o.Releases, types.OpportunityRelease{
Tags: []types.OpportunityReleaseTag{{Tag: tag}},