format

package
v0.0.0-...-04ca6da Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 8, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FormatCodeInComment

func FormatCodeInComment(commentString string) (string, error)

FormatCodeInComment はコメントを与えて、フォーマットしたコメントを返す

func IsGoFile

func IsGoFile(filename string) bool

func TrimCommentMarker

func TrimCommentMarker(comment string) (string, string)

TrimCommentMarker はコメントからコメントマーカ(// や /*)を取り除く pkg.go.dev/go/doc/commentによると(commemt.Parser).Parseの引数にコメントを与えるとき コメントマーカを削除してから与えることになっているため

Types

type File

type File struct {
	Syntax *ast.File
	Fset   *token.FileSet
}

func Parse

func Parse(filename string) (*File, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL