Skip to content

Commit

Permalink
refact: rm useless comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Rennbon committed Dec 13, 2021
1 parent 9c4a207 commit f19b529
Showing 1 changed file with 1 addition and 12 deletions.
13 changes: 1 addition & 12 deletions rows.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,16 +129,9 @@ type Rows struct {
closeErr error
}

// NewRowsFromStruct new Rows from struct reflect with tagName
// tagName default "json"

func newRowsFromStruct(m interface{}, tagName ...string) (*Rows, error) {
/* if m == nil {
return nil, errors.New("param m is nil")
}*/
val := reflect.ValueOf(m).Elem()
/* if val.Kind() != reflect.Struct {
return nil, errors.New("param type must be struct")
}*/
num := val.NumField()
if num == 0 {
return nil, errors.New("no properties available")
Expand Down Expand Up @@ -186,9 +179,6 @@ func NewRowsFromInterface(m interface{}, tagName string) (*Rows, error) {
}
}

// NewRowsFromStructs new Rows from struct slice reflect with tagName
// NOTE: arr must be of the same type
// tagName default "json"
func newRowsFromSliceOrArray(m interface{}, tagName string) (*Rows, error) {
vals := reflect.ValueOf(m)
if vals.Len() == 0 {
Expand All @@ -201,7 +191,6 @@ func newRowsFromSliceOrArray(m interface{}, tagName string) (*Rows, error) {
if typ.NumField() == 0 {
return nil, errors.New("no properties available")
}

var idx []int
tag := "json"
if len(tagName) > 0 {
Expand Down

0 comments on commit f19b529

Please sign in to comment.