Skip to content

Commit

Permalink
support format blank
Browse files Browse the repository at this point in the history
Signed-off-by: Loong <[email protected]>
  • Loading branch information
daixiang0 committed Sep 1, 2022
1 parent 4606d17 commit 1fd5d1b
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions pkg/gci/gci.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"bytes"
"errors"
"fmt"
goFormat "go/format"
"os"
"sync"

Expand Down Expand Up @@ -192,6 +193,11 @@ func LoadFormatGoFile(file io.FileObj, cfg config.Config) (src, dist []byte, err
i += copy(dist[i:], s)
}

dist, err = goFormat.Source(dist)
if err != nil {
return nil, nil, err
}

return src, dist, nil
}

Expand Down

0 comments on commit 1fd5d1b

Please sign in to comment.