code format
This commit is contained in:
parent
7fa1685792
commit
1055774a44
@ -5,16 +5,16 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
type DataSet struct {
|
type DataSet struct {
|
||||||
rows *sql.Rows
|
rows *sql.Rows
|
||||||
columns []string
|
columns []string
|
||||||
values []interface{}
|
values []interface{}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (this *DataSet) Next() bool {
|
func (this *DataSet) Next() bool {
|
||||||
ret := this.rows.Next()
|
ret := this.rows.Next()
|
||||||
this.GetColumns()
|
this.GetColumns()
|
||||||
this.values = []interface{}{}
|
this.values = []interface{}{}
|
||||||
for i := 0 ; i < len(this.columns); i++ {
|
for i := 0; i < len(this.columns); i++ {
|
||||||
str := ""
|
str := ""
|
||||||
this.values = append(this.values, &str)
|
this.values = append(this.values, &str)
|
||||||
}
|
}
|
||||||
@ -52,7 +52,7 @@ func (this *DataSet) GetByName(name string) *string {
|
|||||||
|
|
||||||
func (this *DataSet) GetByIndex(index int32) *string {
|
func (this *DataSet) GetByIndex(index int32) *string {
|
||||||
this.GetColumns()
|
this.GetColumns()
|
||||||
return this.values[index].(*string);
|
return this.values[index].(*string)
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewDataSet(rows *sql.Rows) *DataSet {
|
func NewDataSet(rows *sql.Rows) *DataSet {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user