Skip to content

Commit

Permalink
doc: add comments.
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangtian committed May 7, 2024
1 parent 49b297c commit 9932bbb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions helper/object.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ func CheckObject(obj Object) error {
return nil
}

// Method an object method interface
type Method interface {
// Name return func name
Name() string
Expand All @@ -82,6 +83,7 @@ type Method interface {
Body() string
}

// Param an method param interface
type Param interface {
// PackagePath return package path
PackagePath() string
Expand Down
3 changes: 3 additions & 0 deletions internal/generate/export.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ func getMethodParamFromParamObjs(objs []helper.Param) []parser.Param {
return list
}

// GetMethodFromObj convert helper.Method to parser.Method.
func GetMethodFromObj(md helper.Method) *parser.Method {
return &parser.Method{
Receiver: getMethodParamFromParamObj(md.Receiver()),
Expand All @@ -83,6 +84,8 @@ func GetMethodFromObj(md helper.Method) *parser.Method {
Body: md.Body(),
}
}

// GetMethodSliceFromObj convert helper.Method slice to parser.Method slice.
func GetMethodSliceFromObj(mds []helper.Method) []*parser.Method {
res := make([]*parser.Method, 0, len(mds))
for _, md := range mds {
Expand Down

0 comments on commit 9932bbb

Please sign in to comment.