Skip to content

Commit 9245767

Browse files
authored
refactor: optimise structs to reduce memory usage and add gmail host (#6)
* refactor: optmize structs to reduce memory usage and add gmail host * refactor: removes gmails host
1 parent 0ba1752 commit 9245767

File tree

4 files changed

+8
-6
lines changed

4 files changed

+8
-6
lines changed

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
.idea
2+
13
ultrafocus
24
demo.cast
35
.DS_Store

cli/commands.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ import (
77
)
88

99
type command struct {
10+
Run func(m model) model
1011
Name string
1112
Desc string
12-
Run func(m model) model
1313
}
1414

1515
var commandFocusOn = command{

cli/model.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@ const (
1616
)
1717

1818
type model struct {
19-
commandsListSelection int
19+
textarea textarea.Model
2020
fatalErr error
21+
status hosts.FocusStatus
2122
domains []string
23+
commandsListSelection int
2224
state sessionState
23-
status hosts.FocusStatus
24-
textarea textarea.Model
2525
}
2626

2727
func NewModel() model {

hosts/hosts_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ func TestExtractDomainsFromData(t *testing.T) {
99
tests := []struct {
1010
name string
1111
data string
12-
wantDomains []string
1312
wantStatus FocusStatus
13+
wantDomains []string
1414
wantErr bool
1515
}{
1616
{
@@ -77,9 +77,9 @@ func TestUpdateHostsData(t *testing.T) {
7777
tests := []struct {
7878
name string
7979
originalData string
80-
domains []string
8180
status FocusStatus
8281
wantNewData string
82+
domains []string
8383
wantErr bool
8484
}{
8585
{

0 commit comments

Comments
 (0)