go vet: composite literal uses unkeyed fields

This commit fixes all occurrences of the abovementioned lint-error in
the codebase.

Signed-off-by: Moritz Poldrack <git@moritz.sh>
Acked-by: Robin Jarry <robin@jarry.cc>
This commit is contained in:
Moritz Poldrack 2022-03-18 09:53:02 +01:00 committed by Robin Jarry
parent 62a5ebb1e1
commit e30bd324a3
15 changed files with 102 additions and 102 deletions

View file

@ -136,18 +136,18 @@ func NewAccountWizard(conf *config.AercConfig, aerc *Aerc) *AccountWizard {
})
basics := ui.NewGrid().Rows([]ui.GridSpec{
{ui.SIZE_EXACT, ui.Const(8)}, // Introduction
{ui.SIZE_EXACT, ui.Const(1)}, // Account name (label)
{ui.SIZE_EXACT, ui.Const(1)}, // (input)
{ui.SIZE_EXACT, ui.Const(1)}, // Padding
{ui.SIZE_EXACT, ui.Const(1)}, // Full name (label)
{ui.SIZE_EXACT, ui.Const(1)}, // (input)
{ui.SIZE_EXACT, ui.Const(1)}, // Padding
{ui.SIZE_EXACT, ui.Const(1)}, // Email address (label)
{ui.SIZE_EXACT, ui.Const(1)}, // (input)
{ui.SIZE_WEIGHT, ui.Const(1)},
{Strategy: ui.SIZE_EXACT, Size: ui.Const(8)}, // Introduction
{Strategy: ui.SIZE_EXACT, Size: ui.Const(1)}, // Account name (label)
{Strategy: ui.SIZE_EXACT, Size: ui.Const(1)}, // (input)
{Strategy: ui.SIZE_EXACT, Size: ui.Const(1)}, // Padding
{Strategy: ui.SIZE_EXACT, Size: ui.Const(1)}, // Full name (label)
{Strategy: ui.SIZE_EXACT, Size: ui.Const(1)}, // (input)
{Strategy: ui.SIZE_EXACT, Size: ui.Const(1)}, // Padding
{Strategy: ui.SIZE_EXACT, Size: ui.Const(1)}, // Email address (label)
{Strategy: ui.SIZE_EXACT, Size: ui.Const(1)}, // (input)
{Strategy: ui.SIZE_WEIGHT, Size: ui.Const(1)},
}).Columns([]ui.GridSpec{
{ui.SIZE_WEIGHT, ui.Const(1)},
{Strategy: ui.SIZE_WEIGHT, Size: ui.Const(1)},
})
basics.AddChild(
ui.NewText("\nWelcome to aerc! Let's configure your account.\n\n"+
@ -212,23 +212,23 @@ func NewAccountWizard(conf *config.AercConfig, aerc *Aerc) *AccountWizard {
})
incoming := ui.NewGrid().Rows([]ui.GridSpec{
{ui.SIZE_EXACT, ui.Const(3)}, // Introduction
{ui.SIZE_EXACT, ui.Const(1)}, // Username (label)
{ui.SIZE_EXACT, ui.Const(1)}, // (input)
{ui.SIZE_EXACT, ui.Const(1)}, // Padding
{ui.SIZE_EXACT, ui.Const(1)}, // Password (label)
{ui.SIZE_EXACT, ui.Const(1)}, // (input)
{ui.SIZE_EXACT, ui.Const(1)}, // Padding
{ui.SIZE_EXACT, ui.Const(1)}, // Server (label)
{ui.SIZE_EXACT, ui.Const(1)}, // (input)
{ui.SIZE_EXACT, ui.Const(1)}, // Padding
{ui.SIZE_EXACT, ui.Const(1)}, // Connection mode (label)
{ui.SIZE_EXACT, ui.Const(2)}, // (input)
{ui.SIZE_EXACT, ui.Const(1)}, // Padding
{ui.SIZE_EXACT, ui.Const(1)}, // Connection string
{ui.SIZE_WEIGHT, ui.Const(1)},
{Strategy: ui.SIZE_EXACT, Size: ui.Const(3)}, // Introduction
{Strategy: ui.SIZE_EXACT, Size: ui.Const(1)}, // Username (label)
{Strategy: ui.SIZE_EXACT, Size: ui.Const(1)}, // (input)
{Strategy: ui.SIZE_EXACT, Size: ui.Const(1)}, // Padding
{Strategy: ui.SIZE_EXACT, Size: ui.Const(1)}, // Password (label)
{Strategy: ui.SIZE_EXACT, Size: ui.Const(1)}, // (input)
{Strategy: ui.SIZE_EXACT, Size: ui.Const(1)}, // Padding
{Strategy: ui.SIZE_EXACT, Size: ui.Const(1)}, // Server (label)
{Strategy: ui.SIZE_EXACT, Size: ui.Const(1)}, // (input)
{Strategy: ui.SIZE_EXACT, Size: ui.Const(1)}, // Padding
{Strategy: ui.SIZE_EXACT, Size: ui.Const(1)}, // Connection mode (label)
{Strategy: ui.SIZE_EXACT, Size: ui.Const(2)}, // (input)
{Strategy: ui.SIZE_EXACT, Size: ui.Const(1)}, // Padding
{Strategy: ui.SIZE_EXACT, Size: ui.Const(1)}, // Connection string
{Strategy: ui.SIZE_WEIGHT, Size: ui.Const(1)},
}).Columns([]ui.GridSpec{
{ui.SIZE_WEIGHT, ui.Const(1)},
{Strategy: ui.SIZE_WEIGHT, Size: ui.Const(1)},
})
incoming.AddChild(ui.NewText("\nConfigure incoming mail (IMAP)",
conf.Ui.GetStyle(config.STYLE_DEFAULT)))
@ -291,26 +291,26 @@ func NewAccountWizard(conf *config.AercConfig, aerc *Aerc) *AccountWizard {
})
outgoing := ui.NewGrid().Rows([]ui.GridSpec{
{ui.SIZE_EXACT, ui.Const(3)}, // Introduction
{ui.SIZE_EXACT, ui.Const(1)}, // Username (label)
{ui.SIZE_EXACT, ui.Const(1)}, // (input)
{ui.SIZE_EXACT, ui.Const(1)}, // Padding
{ui.SIZE_EXACT, ui.Const(1)}, // Password (label)
{ui.SIZE_EXACT, ui.Const(1)}, // (input)
{ui.SIZE_EXACT, ui.Const(1)}, // Padding
{ui.SIZE_EXACT, ui.Const(1)}, // Server (label)
{ui.SIZE_EXACT, ui.Const(1)}, // (input)
{ui.SIZE_EXACT, ui.Const(1)}, // Padding
{ui.SIZE_EXACT, ui.Const(1)}, // Connection mode (label)
{ui.SIZE_EXACT, ui.Const(2)}, // (input)
{ui.SIZE_EXACT, ui.Const(1)}, // Padding
{ui.SIZE_EXACT, ui.Const(1)}, // Connection string
{ui.SIZE_EXACT, ui.Const(1)}, // Padding
{ui.SIZE_EXACT, ui.Const(1)}, // Copy to sent (label)
{ui.SIZE_EXACT, ui.Const(2)}, // (input)
{ui.SIZE_WEIGHT, ui.Const(1)},
{Strategy: ui.SIZE_EXACT, Size: ui.Const(3)}, // Introduction
{Strategy: ui.SIZE_EXACT, Size: ui.Const(1)}, // Username (label)
{Strategy: ui.SIZE_EXACT, Size: ui.Const(1)}, // (input)
{Strategy: ui.SIZE_EXACT, Size: ui.Const(1)}, // Padding
{Strategy: ui.SIZE_EXACT, Size: ui.Const(1)}, // Password (label)
{Strategy: ui.SIZE_EXACT, Size: ui.Const(1)}, // (input)
{Strategy: ui.SIZE_EXACT, Size: ui.Const(1)}, // Padding
{Strategy: ui.SIZE_EXACT, Size: ui.Const(1)}, // Server (label)
{Strategy: ui.SIZE_EXACT, Size: ui.Const(1)}, // (input)
{Strategy: ui.SIZE_EXACT, Size: ui.Const(1)}, // Padding
{Strategy: ui.SIZE_EXACT, Size: ui.Const(1)}, // Connection mode (label)
{Strategy: ui.SIZE_EXACT, Size: ui.Const(2)}, // (input)
{Strategy: ui.SIZE_EXACT, Size: ui.Const(1)}, // Padding
{Strategy: ui.SIZE_EXACT, Size: ui.Const(1)}, // Connection string
{Strategy: ui.SIZE_EXACT, Size: ui.Const(1)}, // Padding
{Strategy: ui.SIZE_EXACT, Size: ui.Const(1)}, // Copy to sent (label)
{Strategy: ui.SIZE_EXACT, Size: ui.Const(2)}, // (input)
{Strategy: ui.SIZE_WEIGHT, Size: ui.Const(1)},
}).Columns([]ui.GridSpec{
{ui.SIZE_WEIGHT, ui.Const(1)},
{Strategy: ui.SIZE_WEIGHT, Size: ui.Const(1)},
})
outgoing.AddChild(ui.NewText("\nConfigure outgoing mail (SMTP)",
conf.Ui.GetStyle(config.STYLE_DEFAULT)))
@ -387,10 +387,10 @@ func NewAccountWizard(conf *config.AercConfig, aerc *Aerc) *AccountWizard {
})
complete := ui.NewGrid().Rows([]ui.GridSpec{
{ui.SIZE_EXACT, ui.Const(7)}, // Introduction
{ui.SIZE_WEIGHT, ui.Const(1)}, // Previous / Finish / Finish & open tutorial
{Strategy: ui.SIZE_EXACT, Size: ui.Const(7)}, // Introduction
{Strategy: ui.SIZE_WEIGHT, Size: ui.Const(1)}, // Previous / Finish / Finish & open tutorial
}).Columns([]ui.GridSpec{
{ui.SIZE_WEIGHT, ui.Const(1)},
{Strategy: ui.SIZE_WEIGHT, Size: ui.Const(1)},
})
complete.AddChild(ui.NewText(
"\nConfiguration complete!\n\n"+

View file

@ -58,12 +58,12 @@ func NewAccountView(aerc *Aerc, conf *config.AercConfig, acct *config.AccountCon
}
view.grid = ui.NewGrid().Rows([]ui.GridSpec{
{ui.SIZE_WEIGHT, ui.Const(1)},
{Strategy: ui.SIZE_WEIGHT, Size: ui.Const(1)},
}).Columns([]ui.GridSpec{
{ui.SIZE_EXACT, func() int {
{Strategy: ui.SIZE_EXACT, Size: func() int {
return view.UiConfig().SidebarWidth
}},
{ui.SIZE_WEIGHT, ui.Const(1)},
{Strategy: ui.SIZE_WEIGHT, Size: ui.Const(1)},
})
worker, err := worker.NewWorker(acct.Source, logger)

View file

@ -57,11 +57,11 @@ func NewAerc(conf *config.AercConfig, logger *log.Logger,
statusbar.Push(statusline)
grid := ui.NewGrid().Rows([]ui.GridSpec{
{ui.SIZE_EXACT, ui.Const(1)},
{ui.SIZE_WEIGHT, ui.Const(1)},
{ui.SIZE_EXACT, ui.Const(1)},
{Strategy: ui.SIZE_EXACT, Size: ui.Const(1)},
{Strategy: ui.SIZE_WEIGHT, Size: ui.Const(1)},
{Strategy: ui.SIZE_EXACT, Size: ui.Const(1)},
}).Columns([]ui.GridSpec{
{ui.SIZE_WEIGHT, ui.Const(1)},
{Strategy: ui.SIZE_WEIGHT, Size: ui.Const(1)},
})
grid.AddChild(tabs.TabStrip)
grid.AddChild(tabs.TabContent).At(1, 0)
@ -667,11 +667,11 @@ func errorScreen(s string, conf config.UIConfig) ui.Drawable {
errstyle := conf.GetStyle(config.STYLE_ERROR)
text := ui.NewText(s, errstyle).Strategy(ui.TEXT_CENTER)
grid := ui.NewGrid().Rows([]ui.GridSpec{
{ui.SIZE_WEIGHT, ui.Const(1)},
{ui.SIZE_EXACT, ui.Const(1)},
{ui.SIZE_WEIGHT, ui.Const(1)},
{Strategy: ui.SIZE_WEIGHT, Size: ui.Const(1)},
{Strategy: ui.SIZE_EXACT, Size: ui.Const(1)},
{Strategy: ui.SIZE_WEIGHT, Size: ui.Const(1)},
}).Columns([]ui.GridSpec{
{ui.SIZE_WEIGHT, ui.Const(1)},
{Strategy: ui.SIZE_WEIGHT, Size: ui.Const(1)},
})
grid.AddChild(ui.NewFill(' ', tcell.StyleDefault)).At(0, 0)
grid.AddChild(text).At(1, 0)

View file

@ -783,14 +783,14 @@ func (c *Composer) updateGrid() {
if c.grid == nil {
c.grid = ui.NewGrid().Columns([]ui.GridSpec{
{ui.SIZE_WEIGHT, ui.Const(1)},
{Strategy: ui.SIZE_WEIGHT, Size: ui.Const(1)},
})
}
c.grid.Rows([]ui.GridSpec{
{ui.SIZE_EXACT, ui.Const(height)},
{ui.SIZE_EXACT, ui.Const(1)},
{ui.SIZE_WEIGHT, ui.Const(1)},
{Strategy: ui.SIZE_EXACT, Size: ui.Const(height)},
{Strategy: ui.SIZE_EXACT, Size: ui.Const(1)},
{Strategy: ui.SIZE_WEIGHT, Size: ui.Const(1)},
})
if c.heditors != nil {
@ -979,21 +979,21 @@ func newReviewMessage(composer *Composer, err error) *reviewMessage {
}
spec := []ui.GridSpec{
{ui.SIZE_EXACT, ui.Const(1)},
{Strategy: ui.SIZE_EXACT, Size: ui.Const(1)},
}
for i := 0; i < len(actions)-1; i++ {
spec = append(spec, ui.GridSpec{ui.SIZE_EXACT, ui.Const(1)})
spec = append(spec, ui.GridSpec{Strategy: ui.SIZE_EXACT, Size: ui.Const(1)})
}
spec = append(spec, ui.GridSpec{ui.SIZE_EXACT, ui.Const(2)})
spec = append(spec, ui.GridSpec{ui.SIZE_EXACT, ui.Const(1)})
spec = append(spec, ui.GridSpec{Strategy: ui.SIZE_EXACT, Size: ui.Const(2)})
spec = append(spec, ui.GridSpec{Strategy: ui.SIZE_EXACT, Size: ui.Const(1)})
for i := 0; i < len(composer.attachments)-1; i++ {
spec = append(spec, ui.GridSpec{ui.SIZE_EXACT, ui.Const(1)})
spec = append(spec, ui.GridSpec{Strategy: ui.SIZE_EXACT, Size: ui.Const(1)})
}
// make the last element fill remaining space
spec = append(spec, ui.GridSpec{ui.SIZE_WEIGHT, ui.Const(1)})
spec = append(spec, ui.GridSpec{Strategy: ui.SIZE_WEIGHT, Size: ui.Const(1)})
grid := ui.NewGrid().Rows(spec).Columns([]ui.GridSpec{
{ui.SIZE_WEIGHT, ui.Const(1)},
{Strategy: ui.SIZE_WEIGHT, Size: ui.Const(1)},
})
uiConfig := composer.config.Ui

View file

@ -71,7 +71,7 @@ func NewMessageViewer(acct *AccountView,
)
rows := []ui.GridSpec{
{ui.SIZE_EXACT, ui.Const(headerHeight)},
{Strategy: ui.SIZE_EXACT, Size: ui.Const(headerHeight)},
}
if msg.PGPDetails() != nil {
@ -79,16 +79,16 @@ func NewMessageViewer(acct *AccountView,
if msg.PGPDetails().IsSigned && msg.PGPDetails().IsEncrypted {
height = 2
}
rows = append(rows, ui.GridSpec{ui.SIZE_EXACT, ui.Const(height)})
rows = append(rows, ui.GridSpec{Strategy: ui.SIZE_EXACT, Size: ui.Const(height)})
}
rows = append(rows, []ui.GridSpec{
{ui.SIZE_EXACT, ui.Const(1)},
{ui.SIZE_WEIGHT, ui.Const(1)},
{Strategy: ui.SIZE_EXACT, Size: ui.Const(1)},
{Strategy: ui.SIZE_WEIGHT, Size: ui.Const(1)},
}...)
grid := ui.NewGrid().Rows(rows).Columns([]ui.GridSpec{
{ui.SIZE_WEIGHT, ui.Const(1)},
{Strategy: ui.SIZE_WEIGHT, Size: ui.Const(1)},
})
switcher := &PartSwitcher{}
@ -539,11 +539,11 @@ func NewPartViewer(acct *AccountView, conf *config.AercConfig,
}
grid := ui.NewGrid().Rows([]ui.GridSpec{
{ui.SIZE_EXACT, ui.Const(3)}, // Message
{ui.SIZE_EXACT, ui.Const(1)}, // Selector
{ui.SIZE_WEIGHT, ui.Const(1)},
{Strategy: ui.SIZE_EXACT, Size: ui.Const(3)}, // Message
{Strategy: ui.SIZE_EXACT, Size: ui.Const(1)}, // Selector
{Strategy: ui.SIZE_WEIGHT, Size: ui.Const(1)},
}).Columns([]ui.GridSpec{
{ui.SIZE_WEIGHT, ui.Const(1)},
{Strategy: ui.SIZE_WEIGHT, Size: ui.Const(1)},
})
selector := NewSelector([]string{"Save message", "Pipe to command"},