Skip to content

Commit 478bbce

Browse files
authored
Revert "[WIP]:Add golangci lint"
1 parent 62f54de commit 478bbce

20 files changed

+48
-131
lines changed

.golangci.yml

-80
This file was deleted.

app/app.go renamed to app/App.go

File renamed without changes.
File renamed without changes.

components/connectionForm.go renamed to components/ConnectionForm.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ func (form *ConnectionForm) inputCapture(connectionPages *models.ConnectionPages
144144
func (form *ConnectionForm) testConnection(connectionString string) {
145145
form.StatusText.SetText("Connecting...").SetTextStyle(tcell.StyleDefault.Foreground(tcell.ColorKhaki.TrueColor()))
146146

147-
db := drivers.MySQL{}
147+
db := drivers.MySql{}
148148
db.SetConnectionString(connectionString)
149149

150150
err := db.TestConnection()
File renamed without changes.

components/connectionSelection.go renamed to components/ConnectionSelection.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ func (cs *ConnectionSelection) connect(connectionUrl string) {
133133
cs.StatusText.SetText("Connecting...").SetTextStyle(tcell.StyleDefault.Foreground(app.ActiveTextColor))
134134
App.Draw()
135135

136-
newDbDriver := drivers.MySQL{}
136+
newDbDriver := drivers.MySql{}
137137
newDbDriver.SetConnectionString(connectionUrl)
138138

139139
err := newDbDriver.Connect()
File renamed without changes.

components/home.go renamed to components/Home.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,13 @@ type Home struct {
1616
TabbedPane *TabbedPane
1717
LeftWrapper *tview.Flex
1818
RightWrapper *tview.Flex
19-
DBDriver drivers.MySQL
19+
DBDriver drivers.MySql
2020
FocusedWrapper string
2121
ListOfDbChanges []models.DbDmlChange
2222
ListOfDbInserts []models.DbInsert
2323
}
2424

25-
func NewHomePage(name string, dbdriver drivers.MySQL) *Home {
25+
func NewHomePage(name string, dbdriver drivers.MySql) *Home {
2626
tree := NewTree(&dbdriver)
2727
tabbedPane := NewTabbedPane()
2828
leftWrapper := tview.NewFlex()
File renamed without changes.
File renamed without changes.
File renamed without changes.

components/resultsTable.go renamed to components/ResultsTable.go

+13-13
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ type ResultsTable struct {
4545
EditorPages *tview.Pages
4646
ResultsInfo *tview.TextView
4747
Tree *Tree
48-
DBDriver *drivers.MySQL
48+
DBDriver *drivers.MySql
4949
}
5050

5151
var (
@@ -55,7 +55,7 @@ var (
5555
DeleteColor = tcell.ColorRed
5656
)
5757

58-
func NewResultsTable(listOfDbChanges *[]models.DbDmlChange, listOfDbInserts *[]models.DbInsert, tree *Tree, dbdriver *drivers.MySQL) *ResultsTable {
58+
func NewResultsTable(listOfDbChanges *[]models.DbDmlChange, listOfDbInserts *[]models.DbInsert, tree *Tree, dbdriver *drivers.MySql) *ResultsTable {
5959
state := &ResultsTableState{
6060
records: [][]string{},
6161
columns: [][]string{},
@@ -201,7 +201,7 @@ func (table *ResultsTable) AddInsertedRows() {
201201
for j, cell := range row {
202202
tableCell := tview.NewTableCell(cell)
203203
tableCell.SetExpansion(1)
204-
tableCell.SetReference(inserts[i].RowID)
204+
tableCell.SetReference(inserts[i].RowId)
205205

206206
tableCell.SetTextColor(app.FocusTextColor)
207207
tableCell.SetBackgroundColor(InsertColor)
@@ -397,7 +397,7 @@ func (table *ResultsTable) tableInputCapture(event *tcell.EventKey) *tcell.Event
397397
for i, insertedRow := range *table.state.listOfDbInserts {
398398
cellReference := table.GetCell(selectedRowIndex, 0).GetReference()
399399

400-
if cellReference != nil && insertedRow.RowID.String() == cellReference.(uuid.UUID).String() {
400+
if cellReference != nil && insertedRow.RowId.String() == cellReference.(uuid.UUID).String() {
401401
isAnInsertedRow = true
402402
indexOfInsertedRow = i
403403
}
@@ -447,7 +447,7 @@ func (table *ResultsTable) tableInputCapture(event *tcell.EventKey) *tcell.Event
447447
Table: table.GetDBReference(),
448448
Columns: table.GetRecords()[0],
449449
Values: newRow,
450-
RowID: newRowUuid,
450+
RowId: newRowUuid,
451451
Option: 1,
452452
}
453453

@@ -958,19 +958,19 @@ func (table *ResultsTable) StartEditingCell(row int, col int, callback func(newV
958958
App.SetFocus(inputField)
959959
}
960960

961-
func (table *ResultsTable) CheckIfRowIsInserted(rowID uuid.UUID) bool {
961+
func (table *ResultsTable) CheckIfRowIsInserted(rowId uuid.UUID) bool {
962962
for _, insertedRow := range *table.state.listOfDbInserts {
963-
if insertedRow.RowID == rowID {
963+
if insertedRow.RowId == rowId {
964964
return true
965965
}
966966
}
967967

968968
return false
969969
}
970970

971-
func (table *ResultsTable) MutateInsertedRowCell(rowID uuid.UUID, colIndex int, newValue string) {
971+
func (table *ResultsTable) MutateInsertedRowCell(rowId uuid.UUID, colIndex int, newValue string) {
972972
for i, insertedRow := range *table.state.listOfDbInserts {
973-
if insertedRow.RowID == rowID {
973+
if insertedRow.RowId == rowId {
974974
(*table.state.listOfDbInserts)[i].Values[colIndex] = newValue
975975
}
976976
}
@@ -992,13 +992,13 @@ func (table *ResultsTable) AppendNewChange(changeType string, tableName string,
992992
}
993993

994994
if !isInsertedRow {
995-
selectedRowID := table.GetRecords()[rowIndex][0]
995+
selectedRowId := table.GetRecords()[rowIndex][0]
996996

997997
alreadyExists := false
998998
indexOfChange := -1
999999

10001000
for i, change := range *table.state.listOfDbChanges {
1001-
if change.RowID == selectedRowID && change.Column == table.GetColumnNameByIndex(colIndex) {
1001+
if change.RowId == selectedRowId && change.Column == table.GetColumnNameByIndex(colIndex) {
10021002
alreadyExists = true
10031003
indexOfChange = i
10041004
}
@@ -1038,7 +1038,7 @@ func (table *ResultsTable) AppendNewChange(changeType string, tableName string,
10381038
Table: tableName,
10391039
Column: columnName,
10401040
Value: value,
1041-
RowID: selectedRowID,
1041+
RowId: selectedRowId,
10421042
Option: 1,
10431043
}
10441044

@@ -1078,7 +1078,7 @@ func (table *ResultsTable) AppendNewChange(changeType string, tableName string,
10781078
Table: tableName,
10791079
Column: "",
10801080
Value: "",
1081-
RowID: selectedRowID,
1081+
RowId: selectedRowId,
10821082
Option: 1,
10831083
}
10841084

File renamed without changes.
File renamed without changes.
File renamed without changes.

components/tree.go renamed to components/Tree.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@ type TreeState struct {
1919
type Tree struct {
2020
*tview.TreeView
2121
state *TreeState
22-
DBDriver *drivers.MySQL
22+
DBDriver *drivers.MySql
2323
subscribers []chan models.StateChange
2424
}
2525

26-
func NewTree(dbdriver *drivers.MySQL) *Tree {
26+
func NewTree(dbdriver *drivers.MySql) *Tree {
2727
state := &TreeState{
2828
selectedDatabase: "",
2929
selectedTable: "",

0 commit comments

Comments
 (0)