yjp 1 rok temu
rodzic
commit
ca4f0ca3d1
1 zmienionych plików z 9 dodań i 5 usunięć
  1. 9 5
      client/table_row.go

+ 9 - 5
client/table_row.go

@@ -17,11 +17,6 @@ func NewTableRow() *TableRow {
 	return &TableRow{row: make(map[string]any)}
 }
 
-func (tableRow *TableRow) AddColumnValue(columnName string, value any) *TableRow {
-	tableRow.row[columnName] = value
-	return tableRow
-}
-
 func (tableRow *TableRow) AddColumnValueTime(columnName string, value time.Time) *TableRow {
 	tableRow.row[columnName] = value
 	return tableRow
@@ -97,6 +92,15 @@ func (tableRow *TableRow) AddColumnValueFloat64(columnName string, value float64
 	return tableRow
 }
 
+func (tableRow *TableRow) ColumnValue(columnName string) any {
+	value, ok := tableRow.row[columnName]
+	if !ok {
+		return nil
+	}
+
+	return value
+}
+
 func (tableRow *TableRow) ColumnValueTime(columnName string) time.Time {
 	value, ok := tableRow.row[columnName].(time.Time)
 	if !ok {