Skip to content

Commit

Permalink
rename AddNodeToFuncBodyBefore/After to AddStmtToFuncBodyBefore/After
Browse files Browse the repository at this point in the history
  • Loading branch information
zhenghe3119 committed Jul 5, 2019
1 parent 2e10bb0 commit 80cc2a4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ DeleteStmtFromFuncBody(df *dst.File, funcName string, stmt dst.Stmt) (modified b
AddStmtToFuncBody(df *dst.File, funcName string, stmt dst.Stmt, pos int) (modified bool)
AddStmtToFuncBodyStart(df *dst.File, funcName string, stmt dst.Stmt) (modified bool)
AddStmtToFuncBodyEnd(df *dst.File, funcName string, stmt dst.Stmt) (modified bool)
AddNodeToFuncBodyBefore(df *dst.File, funcName string, stmt, refStmt dst.Stmt) (modified bool)
AddNodeToFuncBodyAfter(df *dst.File, funcName string, stmt, refStmt dst.Stmt) (modified bool)
AddStmtToFuncBodyBefore(df *dst.File, funcName string, stmt, refStmt dst.Stmt) (modified bool)
AddStmtToFuncBodyAfter(df *dst.File, funcName string, stmt, refStmt dst.Stmt) (modified bool)
```

### function call utilities
Expand Down
8 changes: 4 additions & 4 deletions func_body.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,14 +134,14 @@ func addStmtToFuncBodyRelativeTo(df *dst.File, funcName string, stmt, refStmt ds
return
}

// AddNodeToFuncBodyBefore adds given statement, to the function body, before the position of refStmt.
// AddStmtToFuncBodyBefore adds given statement, to the function body, before the position of refStmt.
// if refStmt not found, nothing will happen
func AddNodeToFuncBodyBefore(df *dst.File, funcName string, stmt, refStmt dst.Stmt) (modified bool) {
func AddStmtToFuncBodyBefore(df *dst.File, funcName string, stmt, refStmt dst.Stmt) (modified bool) {
return addStmtToFuncBodyRelativeTo(df, funcName, stmt, refStmt, relativeDirectionBefore)
}

// AddNodeToFuncBodyAfter adds given statement, to the function body, after the position of refStmt,
// AddStmtToFuncBodyAfter adds given statement, to the function body, after the position of refStmt,
// if refStmt not found, nothing will happen
func AddNodeToFuncBodyAfter(df *dst.File, funcName string, stmt, refStmt dst.Stmt) (modified bool) {
func AddStmtToFuncBodyAfter(df *dst.File, funcName string, stmt, refStmt dst.Stmt) (modified bool) {
return addStmtToFuncBodyRelativeTo(df, funcName, stmt, refStmt, relativeDirectionAfter)
}

0 comments on commit 80cc2a4

Please sign in to comment.