Skip to content

Commit 9badd4c

Browse files
committed
feat(gofmt): RunRewrite deprecation
1 parent 9e463eb commit 9badd4c

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

gofmt/golangci.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,13 @@ type RewriteRule struct {
2727
}
2828

2929
// Run runs gofmt.
30-
// Deprecated: use RunRewrite instead.
30+
// Deprecated: use [Source] instead.
3131
func Run(filename string, needSimplify bool) ([]byte, error) {
3232
return RunRewrite(filename, needSimplify, nil)
3333
}
3434

3535
// RunRewrite runs gofmt.
36-
// empty string `rewrite` will be ignored.
36+
// Deprecated: use [Source] instead.
3737
func RunRewrite(filename string, needSimplify bool, rewriteRules []RewriteRule) ([]byte, error) {
3838
src, err := os.ReadFile(filename)
3939
if err != nil {
@@ -78,6 +78,8 @@ func RunRewrite(filename string, needSimplify bool, rewriteRules []RewriteRule)
7878
return diff.Diff(oldName, src, newName, res), nil
7979
}
8080

81+
// Source formats the code like gofmt.
82+
// Empty string `rewrite` will be ignored.
8183
func Source(filename string, src []byte, opts Options) ([]byte, error) {
8284
fset := token.NewFileSet()
8385

0 commit comments

Comments
 (0)