Skip to content

Commit c4da6e5

Browse files
committed
[*] fix golint complains
1 parent 64d2a5a commit c4da6e5

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

lgensemble_io.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -221,11 +221,11 @@ func LGEnsembleFromReader(reader *bufio.Reader) (*LGEnsemble, error) {
221221
if err := mapValueCompare(params, "num_tree_per_iteration", "1"); err != nil {
222222
return nil, err
223223
}
224-
if maxFeatureIdx, err := mapValueToInt(params, "max_feature_idx"); err != nil {
224+
maxFeatureIdx, err := mapValueToInt(params, "max_feature_idx")
225+
if err != nil {
225226
return nil, err
226-
} else {
227-
e.MaxFeatureIdx = uint32(maxFeatureIdx)
228227
}
228+
e.MaxFeatureIdx = uint32(maxFeatureIdx)
229229

230230
treeSizesStr, isFound := params["tree_sizes"]
231231
if !isFound {

mat_io.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ func DenseMatFromLibsvm(reader *bufio.Reader, limit uint32, skipFirstColumn bool
3131
return mat, fmt.Errorf("too few columns")
3232
}
3333

34-
column := uint32(0)
34+
var column uint32
3535
for col := startIndex; col < uint32(len(tokens)); col++ {
3636
if len(tokens[col]) == 0 {
3737
break
@@ -93,7 +93,7 @@ func CSRMatFromLibsvm(reader *bufio.Reader, limit uint32, skipFirstColumn bool)
9393
}
9494

9595
mat.RowHeaders = append(mat.RowHeaders, uint32(len(mat.Values)))
96-
column := uint32(0)
96+
var column uint32
9797
for col := startIndex; col < uint32(len(tokens)); col++ {
9898
if len(tokens[col]) == 0 {
9999
break
@@ -150,7 +150,7 @@ func DenseMatFromCsv(reader *bufio.Reader,
150150
}
151151
tokens := strings.Split(line, delimiter)
152152

153-
column := uint32(0)
153+
var column uint32
154154
for col := startIndex; col < uint32(len(tokens)); col++ {
155155
var value float64
156156
if len(tokens[col]) == 0 {

0 commit comments

Comments
 (0)