Documentation ¶
Index ¶
- func ExtractGoCode(data []byte) string
- func GetFromRemote(ctx context.Context, rawURL string) (string, error)
- func MapGoComments(f ast.Node) map[string]*StructComment
- func MergeField(oldfield, newfield *ast.Field) *ast.Field
- func MergeStructComments(oldComments, newComments map[string]*StructComment) map[string]*StructComment
- func RebuildCommentPos(fwriter io.Writer, fset *token.FileSet, f *ast.File, ...) error
- func ResetCommentsPos(comments *ast.CommentGroup) *ast.CommentGroup
- func UpdateGoFile(ctx context.Context, file string, output *bytes.Buffer) error
- func WriteToCache(ctx context.Context, dest string, out string, namePattern string) (string, error)
- type Result
- type Results
- type StructComment
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExtractGoCode ¶
The data is normally a combination of go code (with triple quote code blocks marker ```go ... ```) and wording explanation for the recommendation.
func MapGoComments ¶
func MapGoComments(f ast.Node) map[string]*StructComment
ast Docs and comments are not binding with the Decl but the relative position of the Node, so we have to handle it specifically.
func MergeStructComments ¶
func MergeStructComments(oldComments, newComments map[string]*StructComment) map[string]*StructComment
func RebuildCommentPos ¶
func ResetCommentsPos ¶
func ResetCommentsPos(comments *ast.CommentGroup) *ast.CommentGroup
func UpdateGoFile ¶
UpdateGoFile update the `fileName` gofile with the content in `output`.
Types ¶
type Results ¶
type Results []Result
func CompareStruct ¶
If codefactors is given, only compare the go structs whose name match the codefactor list.
type StructComment ¶
type StructComment struct { Name *ast.Ident Comment *ast.CommentGroup Fields map[string]*ast.CommentGroup }
func (*StructComment) SetCommentPos ¶
func (s *StructComment) SetCommentPos(offset token.Pos) token.Pos
Click to show internal directories.
Click to hide internal directories.