Skip to content

Commit

Permalink
feat:updating links
Browse files Browse the repository at this point in the history
  • Loading branch information
Iván Corrales Solera committed Dec 4, 2019
1 parent 43799e4 commit cd7e8e5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
10 changes: 5 additions & 5 deletions adapter/internal/stmt.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ func ifArgumentValueIsNotNil(variable string, stmt ast.Stmt) ast.Stmt {
}
}

//nolint:funlen
func appendResultsStatements(results []*FieldDef) []ast.Stmt {
stmts := make([]ast.Stmt, 0)
stmts = append(stmts, &ast.AssignStmt{
Expand Down Expand Up @@ -101,7 +102,7 @@ func appendResultsStatements(results []*FieldDef) []ast.Stmt {
Type: result.Kind,
},
},
Tok:token.VAR,
Tok: token.VAR,
},
})

Expand All @@ -114,10 +115,10 @@ func appendResultsStatements(results []*FieldDef) []ast.Stmt {
},
},
Op: token.NEQ,
Y:NewIdentObj("nil"),
Y: NewIdentObj("nil"),
},
Body:&ast.BlockStmt{
List:[]ast.Stmt{
Body: &ast.BlockStmt{
List: []ast.Stmt{
&ast.AssignStmt{
Lhs: []ast.Expr{
NewIdentObj(fmt.Sprintf("result%v", i)),
Expand All @@ -139,7 +140,6 @@ func appendResultsStatements(results []*FieldDef) []ast.Stmt {
},
})


returnExpr[i] = NewIdent(fmt.Sprintf("result%v", i))
}

Expand Down
3 changes: 1 addition & 2 deletions advice/ast.go
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ func adviceCallText(ar ast.Expr) string {

argText = fmt.Sprintf("%s(%s)", adviceCallText(a.Fun), strings.Join(args, ","))
case *ast.BinaryExpr:
argText = fmt.Sprintf("%s %s %s",adviceCallText(a.X),a.Op.String(),adviceCallText(a.Y))
argText = fmt.Sprintf("%s %s %s", adviceCallText(a.X), a.Op.String(), adviceCallText(a.Y))
default:
argText = unsupportedType(reflect.TypeOf(a).String())
}
Expand Down Expand Up @@ -227,7 +227,6 @@ func addAdviceCallExpr(arg *ast.CallExpr, importSpecs []*ast.ImportSpec, invocat
pointer: isPointer,
})
} else {

invocationArgs = append(invocationArgs, &adviceInvocationArg{
val: argText,
})
Expand Down

0 comments on commit cd7e8e5

Please sign in to comment.