Skip to content

Commit cf7cabc

Browse files
committed
fix: formatting via gofmt
1 parent 0eec79b commit cf7cabc

File tree

4 files changed

+17
-19
lines changed

4 files changed

+17
-19
lines changed

internal/backend/collections/manager.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,12 +100,12 @@ func (c *CollectionsManager) List(ctx context.Context) ([]CollectionEntity, erro
100100
if err != nil {
101101
return nil, err
102102
}
103-
103+
104104
entities := make([]CollectionEntity, len(collections))
105105
for i, collection := range collections {
106106
entities[i] = CollectionEntity{Collection: collection}
107107
}
108-
108+
109109
return entities, nil
110110
}
111111

internal/backend/collections/models.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ func (c CollectionEntity) GetName() string {
1919
return c.Name
2020
}
2121

22-
2322
func (c CollectionEntity) GetCreatedAt() time.Time {
2423
return crud.ParseTimestamp(c.CreatedAt)
2524
}

internal/tui/app/model.go

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -68,15 +68,15 @@ func (a AppModel) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
6868
}
6969
case messages.NavigateToView:
7070
a.Views[a.focusedView].OnBlur()
71-
71+
7272
if msg.Data != nil {
7373
err := a.Views[ViewName(msg.ViewName)].SetState(msg.Data)
7474
if err != nil {
7575
log.Error("failed to set view state during navigation", "target_view", msg.ViewName, "error", err)
7676
return a, nil
7777
}
7878
}
79-
79+
8080
a.focusedView = ViewName(msg.ViewName)
8181
a.Views[a.focusedView].OnFocus()
8282
return a, nil
@@ -112,25 +112,25 @@ func (a AppModel) View() string {
112112
header := a.Header()
113113
view := a.Views[a.focusedView].View()
114114
help := a.Help()
115-
115+
116116
if a.errorMsg != "" {
117117
errorBar := styles.ErrorBarStyle.Width(a.width).Render("Error: " + a.errorMsg)
118118
return lipgloss.JoinVertical(lipgloss.Top, header, view, errorBar, help, footer)
119119
}
120-
120+
121121
return lipgloss.JoinVertical(lipgloss.Top, header, view, help, footer)
122122
}
123123

124124
func (a AppModel) Help() string {
125125
viewHelp := a.Views[a.focusedView].Help()
126-
126+
127127
var appHelp []key.Binding
128128
appHelp = append(appHelp, a.keys...)
129-
129+
130130
if a.focusedView == Endpoints {
131131
appHelp = append(appHelp, keybinds.Keys.Back)
132132
}
133-
133+
134134
allHelp := append(viewHelp, appHelp...)
135135
helpStruct := keybinds.Help{
136136
Keys: allHelp,
@@ -197,4 +197,3 @@ func NewAppModel(ctx *Context) AppModel {
197197
}
198198
return model
199199
}
200-

internal/tui/views/collections-view.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -55,12 +55,12 @@ func (c CollectionsView) Update(msg tea.Msg) (ViewInterface, tea.Cmd) {
5555
case messages.ItemAdded:
5656
_, err := c.manager.Create(context.Background(), msg.Item)
5757
if err != nil {
58-
return c, func() tea.Msg {
59-
return messages.ShowError{Message: err.Error()}
58+
return c, func() tea.Msg {
59+
return messages.ShowError{Message: err.Error()}
6060
}
6161
}
62-
return c, func() tea.Msg {
63-
return messages.RefreshItemsList{}
62+
return c, func() tea.Msg {
63+
return messages.RefreshItemsList{}
6464
}
6565
case messages.RefreshItemsList:
6666
c.list.RefreshItems()
@@ -100,7 +100,7 @@ func (c CollectionsView) OnBlur() {
100100

101101
func itemMapper(items []collections.CollectionEntity, endpointsManager *endpoints.EndpointsManager) []list.Item {
102102
opts := make([]list.Item, len(items))
103-
103+
104104
counts, err := endpointsManager.GetCountsByCollections(context.Background())
105105
if err != nil {
106106
for i, item := range items {
@@ -112,12 +112,12 @@ func itemMapper(items []collections.CollectionEntity, endpointsManager *endpoint
112112
}
113113
return opts
114114
}
115-
115+
116116
countMap := make(map[int64]int)
117117
for _, count := range counts {
118118
countMap[count.CollectionID] = int(count.Count)
119119
}
120-
120+
121121
for i, item := range items {
122122
count := countMap[item.GetID()]
123123
opts[i] = optionsProvider.Option{
@@ -126,7 +126,7 @@ func itemMapper(items []collections.CollectionEntity, endpointsManager *endpoint
126126
ID: item.GetID(),
127127
}
128128
}
129-
129+
130130
return opts
131131
}
132132

0 commit comments

Comments
 (0)